Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
Fix #274 - Add eslint-plugin-react-hooks and fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nonameolsson committed Aug 18, 2020
1 parent e83e90d commit 5875ac1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
7 changes: 2 additions & 5 deletions boilerplate/app/components/switch/switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,9 @@ export function Switch(props: SwitchProps) {
startAnimation(props.value)
setPreviousValue(props.value)
}
}, [props.value])
}, [previousValue, props.value, startAnimation])

const handlePress = React.useMemo(() => () => props.onToggle && props.onToggle(!props.value), [
props.onToggle,
props.value,
])
const handlePress = React.useMemo(() => () => props.onToggle && props.onToggle(!props.value), [props])

if (!timer) {
return null
Expand Down
1 change: 1 addition & 0 deletions boilerplate/app/services/reactotron/reactotron.ts.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export class Reactotron {
if (this.config.useAsyncStorage) {
Tron.setAsyncStorageHandler(AsyncStorage)
}
// eslint-disable-next-line react-hooks/rules-of-hooks
Tron.useReactNative({
asyncStorage: this.config.useAsyncStorage ? undefined : false,
})
Expand Down
2 changes: 2 additions & 0 deletions boilerplate/package.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react-native": "^3.6.0",
"eslint-plugin-react-hooks": "^4.1.0",
"eslint-plugin-standard": "^4.0.0",
"jest": "25.5.4",
<% if (props.useExpo) { -%>
Expand Down Expand Up @@ -158,6 +159,7 @@
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-native/all",
"plugin:react-hooks/recommended",
"standard"
],
"parserOptions": {
Expand Down

0 comments on commit 5875ac1

Please sign in to comment.