Skip to content

Commit b207aee

Browse files
committed
Add initial primitive dispatcher tests
1 parent 448ff7d commit b207aee

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,6 @@ function useRef<T>(initialValue: T): { current: T } {
231231
const previousRef = workInProgressHook.memoizedState
232232
if (previousRef === null) {
233233
const ref = { current: initialValue }
234-
if (__DEV__) {
235-
Object.seal(ref)
236-
}
237234
workInProgressHook.memoizedState = ref
238235
return ref
239236
} else {

0 commit comments

Comments
 (0)