In my recently works. I have alway Wrap function, value declarations, expressions into React.useMemo or React.useCallback.
And I must find all the depends on the selection. And always missing some deps. It's not a good experience.
Could we provide some refactors to wrap something into well-known react hooks?
I'm not sure where's the bar of patterns we are allowed. but we have already had something like 'react-jsx'.
Search Terms
refactor, react, hooks
Suggestion
Provide a series of refactors about react hooks.
Use Cases
In my recently works. I have alway Wrap function, value declarations, expressions into
React.useMemo
orReact.useCallback
. And I must find all the depends on the selection. And always missing some deps. It's not a good experience.Could we provide some refactors to wrap something into well-known react hooks?
I'm not sure where's the bar of patterns we are allowed. but we have already had something like 'react-jsx'.
Examples
props.a + props.b
, convert intohandleClick
or the lambda, convert into<SomeHeavyComponent value={value}/>
, convert intoChecklist
My suggestion meets these guidelines: