mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-25 07:34:45 +00:00
Add eslint-plugin-react-hooks
This commit is contained in:
@@ -8,19 +8,19 @@ export default function StateChanges() {
|
||||
currentState: AppState.currentState
|
||||
});
|
||||
|
||||
const handleChange = nextState => {
|
||||
updateState(previousState => ({
|
||||
...previousState,
|
||||
[nextState]: previousState[nextState] + 1
|
||||
}));
|
||||
};
|
||||
|
||||
React.useEffect(() => {
|
||||
const handleChange = nextState => {
|
||||
updateState(previousState => ({
|
||||
...previousState,
|
||||
[nextState]: previousState[nextState] + 1
|
||||
}));
|
||||
};
|
||||
|
||||
AppState.addEventListener('change', handleChange);
|
||||
return () => {
|
||||
AppState.removeEventListener('change', handleChange);
|
||||
};
|
||||
}, [handleChange]);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<View>
|
||||
|
||||
@@ -70,6 +70,6 @@ export default function usePlatformMethods(
|
||||
}
|
||||
};
|
||||
},
|
||||
[classList, hostRef, ref, style]
|
||||
[classList, hostRef, style]
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user