+16
-0
lines changedFilter options
+16
-0
lines changed Original file line number Diff line number Diff line change
@@ -290,6 +290,22 @@ describe('ReactShallowRenderer with hooks', () => {
290
290
expect(firstResult).toEqual(secondResult);
291
291
});
292
292
293
+
it('should work with useCallback', () => {
294
+
function SomeComponent() {
295
+
const noop = React.useCallback(() => {}, []);
296
+
297
+
return (
298
+
<div onClick={noop} />
299
+
);
300
+
}
301
+
302
+
const shallowRenderer = createRenderer();
303
+
let firstResult = shallowRenderer.render(<SomeComponent />);
304
+
let secondResult = shallowRenderer.render(<SomeComponent />);
305
+
306
+
expect(firstResult).toEqual(secondResult);
307
+
});
308
+
293
309
it('should work with useContext', () => {
294
310
const SomeContext = React.createContext('default');
295
311
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4