You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For my program I have made the distinction between hooks that provide state (like useState), that consume state (like useEffect) and ones that do both (useCallback or useMemo).
For the first and second group the order can be static, but for the third one I could need to call useCallback before useMemo or vice versa. Because they can use each other as dependencies:
For these two hooks it may seem a little constructed, but for other (custom) hooks this will be important.
I would wish I could specify an array inside the groups config so I can order these specific functions as I like, but not at any place in the file. The config could look like this:
For my program I have made the distinction between hooks that provide state (like
useState
), that consume state (likeuseEffect
) and ones that do both (useCallback
oruseMemo
).For the first and second group the order can be static, but for the third one I could need to call
useCallback
beforeuseMemo
or vice versa. Because they can use each other as dependencies:For these two hooks it may seem a little constructed, but for other (custom) hooks this will be important.
I would wish I could specify an array inside the
groups
config so I can order these specific functions as I like, but not at any place in the file. The config could look like this:The text was updated successfully, but these errors were encountered: