diff --git a/package.json b/package.json index c4d4c8e..f021d73 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "author": "The Nerdy Canuck", "license": "MIT", "devDependencies": { + "@types/node": "^17.0.1", "@types/react": "^17.0.37", "@types/react-dom": "^17.0.11", "react": "^17.0.2", diff --git a/src/components/Button.tsx b/src/components/Button.tsx index 5c7fd95..1422bb5 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -3,21 +3,19 @@ import React from 'react'; export interface IButtonProps extends React.DetailedHTMLProps, HTMLButtonElement> { backgroundColor?: string; color?: string; - style?: React.CSSProperties; } export const Button: React.FunctionComponent = (props) => { - const { children, backgroundColor, style } = props; + const { children, backgroundColor, color, style } = props; + + let _style = style; + + /** Override Defaults */ + if (backgroundColor && _style) _style.backgroundColor = backgroundColor; + if (color && _style) _style.color = color; return ( - ); diff --git a/tsconfig.json b/tsconfig.json index 1a25aa2..93b2d7a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,7 @@ "outDir": "dist/esm", "sourceMap": true, "strict": true, - "target": "es5" + "target": "es6" }, "include": ["src/**/*.ts", "src/**/*.tsx"] }