Quantcast
Channel: Test react forceUpdate custom hook useEffect/useState - Stack Overflow
Browsing all 2 articles
Browse latest 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 all 2 articles
Browse latest View live




Latest Images