We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 448ff7d commit b207aeeCopy full SHA for b207aee
src/internals/__tests__/dispatcher.test.js
@@ -0,0 +1,14 @@
1
+import { Dispatcher } from '../dispatcher'
2
+
3
+describe('useEffect', () => {
4
+ it('is a noop', () => {
5
+ expect(Dispatcher.useEffect).not.toThrow()
6
+ })
7
+})
8
9
+describe('useCallback', () => {
10
+ it('is an identity function', () => {
11
+ const fn = () => {}
12
+ expect(Dispatcher.useCallback(fn)).toBe(fn)
13
14
src/internals/dispatcher.js
@@ -231,9 +231,6 @@ function useRef<T>(initialValue: T): { current: T } {
231
const previousRef = workInProgressHook.memoizedState
232
if (previousRef === null) {
233
const ref = { current: initialValue }
234
- if (__DEV__) {
235
- Object.seal(ref)
236
- }
237
workInProgressHook.memoizedState = ref
238
return ref
239
} else {
0 commit comments