Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3379355
D3680.id11260.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
397 B
Referenced Files
None
Subscribers
None
D3680.id11260.diff
View Options
diff --git a/lib/hooks/useIsomorphicLayoutEffect.react.js b/lib/hooks/useIsomorphicLayoutEffect.react.js
new file mode 100644
--- /dev/null
+++ b/lib/hooks/useIsomorphicLayoutEffect.react.js
@@ -0,0 +1,6 @@
+// @flow
+
+import * as React from 'react';
+
+export const useIsomorphicLayoutEffect: typeof React.useEffect =
+ typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 28, 3:33 PM (22 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2594329
Default Alt Text
D3680.id11260.diff (397 B)
Attached To
Mode
D3680: [lib] [feat] add useIsomorphicLayoutEffect hook
Attached
Detach File
Event Timeline
Log In to Comment