mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +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:
-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