mirror of
https://github.com/wassname/talk.git
synced 2026-06-27 15:17:24 +08:00
remove duplicate code and add comment to wrapper component (#3076)
* remove duplicate code and add comment to wrapper component: * use react hooks recommended settings
This commit is contained in:
+1
-2
@@ -176,6 +176,7 @@ module.exports = {
|
||||
"eslint:recommended",
|
||||
"plugin:jsdoc/recommended",
|
||||
"plugin:prettier/recommended",
|
||||
"plugin:react-hooks/recommended",
|
||||
],
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018,
|
||||
@@ -237,7 +238,5 @@ module.exports = {
|
||||
"sort-imports": "off",
|
||||
"use-isnan": "error",
|
||||
"valid-typeof": "off",
|
||||
"react-hooks/rules-of-hooks": "warn",
|
||||
"react-hooks/exhaustive-deps": "warn",
|
||||
},
|
||||
};
|
||||
|
||||
-4
@@ -44,10 +44,6 @@ const SpinnerWhileRendering: FunctionComponent<Props> = (props) => {
|
||||
// Ensure window has bee
|
||||
return callWhenReallyIdle(() => setHidden(false));
|
||||
}, [setHidden]);
|
||||
// In our tests, we don't actually "render", so just skip this.
|
||||
if (process.env.NODE_ENV === "test") {
|
||||
return <>{props.children}</>;
|
||||
}
|
||||
return (
|
||||
<>
|
||||
{hidden && (
|
||||
|
||||
+1
@@ -7,6 +7,7 @@ interface Props {
|
||||
}
|
||||
|
||||
const SpinnerWhileRenderingWrapper: FunctionComponent<Props> = (props) => {
|
||||
// In our tests, we don't actually "render", so just skip this.
|
||||
if (process.env.NODE_ENV === "test") {
|
||||
return <>{props.children}</>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user