Quantcast
Channel: Test react forceUpdate custom hook useEffect/useState - Stack Overflow
Browsing latest articles
Browse All 2 View Live

Answer by Rafael Simões for Test react forceUpdate custom hook...

I was able to successfully test this hook this way import React from "react"; import useForceUpdate from "hooks/use-force-update"; const Component = ({ shouldUpdate }) => { const hasUpdated =...

View Article


Test react forceUpdate custom hook useEffect/useState

I created a custom hook to force a component to update but I'm having issues figuring out how to write a unit test with jest. This is the hook function useForceUpdate(condition) { const [, setState] =...

View Article

Browsing latest articles
Browse All 2 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>