Example.
When passing something like an object to useMemo the error isn't very helpful.
TypeError: nextCreate is not a function
at mountMemo (https://grhhp.csb.app/node_modules/react-dom/cjs/react-dom.development.js:13459:19)
...
Most developers wont know what nextCreate is, and passing an object to useMemo doesn't seem obviously wrong at first. We could add a typeof check that throws a better error, but maybe that's too much overhead? At the very least we could add a DEV warning with more helpful guidance.
Example.
When passing something like an object to
useMemothe error isn't very helpful.Most developers wont know what
nextCreateis, and passing an object touseMemodoesn't seem obviously wrong at first. We could add atypeofcheck that throws a better error, but maybe that's too much overhead? At the very least we could add a DEV warning with more helpful guidance.