Skip to content

Commit

Permalink
fix: rewrite with functional component api
Browse files Browse the repository at this point in the history
  • Loading branch information
oflisback committed Mar 12, 2023
1 parent e428b69 commit d322a4f
Show file tree
Hide file tree
Showing 8 changed files with 246 additions and 264 deletions.
24 changes: 14 additions & 10 deletions example/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,23 @@ module.exports = {
es2021: true,
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
overrides: [],
parser: "@typescript-eslint/parser",
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ["react", "@typescript-eslint"],
plugins: ['react', 'react-hooks', '@typescript-eslint'],
rules: {
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
},
};
settings: {
react: { version: 'detect' },
},
}
1 change: 1 addition & 0 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@vitejs/plugin-react": "^3.1.0",
"eslint": "^8.36.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"prettier": "^2.8.4",
"typescript": "^4.9.3",
"vite": "^4.1.0"
Expand Down
6 changes: 5 additions & 1 deletion example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ const App = () => {
type='number'
value={alertCount ? alertCount : 0}
onChange={(e) => setAlertCount(parseInt(e.target.value))}
style={{ width: '35px', marginLeft: '10px' }}
/>
</div>
<div style={{ alignItems: 'center', display: 'flex' }}>
Expand Down Expand Up @@ -190,9 +191,12 @@ const App = () => {
margin: '2px',
width: '25px',
height: '20px',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}}
>
{size}
<div style={{ height: '16px' }}>{size}</div>
</div>
)
)}
Expand Down
11 changes: 11 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion react-favicon.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ export interface FaviconProps {
readonly iconSize?: number
}

declare const Favicon: React.Component<FaviconProps>
declare const Favicon: React.SFC<FaviconProps>

export default Favicon
251 changes: 0 additions & 251 deletions src/index.js

This file was deleted.

Loading

0 comments on commit d322a4f

Please sign in to comment.