Open c-betton opened 7 months ago
always wrap value into useMemo before passing it into ContextProvider, same with custom hooks return object, or better just inline your custom hook. Believe me, it is bad abstraction.
always wrap value into useMemo before passing it into ContextProvider, same with custom hooks return object, or better just inline your custom hook. Believe me, it is bad abstraction.
Thanks a lot for your answer, Could you please give me an example?
Hello all,
I'm starting using the 'why-did-you-render' library. I would like to track my custom hooks but it seems not working on my side.
Here is my configuration (starting with only one custom hook to simplify) set in the 'wdyr.ts' file content:![image](https://github.com/welldone-software/why-did-you-render/assets/157143877/a0199f39-3779-4887-b789-9b4e3d6ca278)
And the custom hook I'm using export const useUploadApk = (): UploadApk => { ... const [callGetUrl, setCallGetUrl] = useState(false) const [callUpload, setCallUpload] = useState(false) ... }
This custom hook is using useState hook and is called from a form. When running the App, I got the following trace:![image](https://github.com/welldone-software/why-did-you-render/assets/157143877/00fcec51-f00f-4226-b397-6e7edd4e54dc)
I was expecting to see my custom hook name (useUploadApk) in the trace... Do I miss something in trackExtraHooks syntax? Thanks a lot in advance for any help.