We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
@reskript/no-useless-memo-hooks
重现 Case:
const getInitialValues = useCallback( () => template, [template] );
@reskript/no-useless-memo-hooks 提示 Hook useCallback's should be removed
Hook useCallback's should be removed
但实际上,我希望仅当 template 的值发生变更时使用新的 callback,而当 template 的值没有变化时不更新 callback 的引用。在这种情况下,useCallback 是需要的。
template
callback
useCallback