-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Using effects in components typically leads to business logic leaks into view. A cleaner approach is to use events instead of effects.
I suggest to add corresponding rule to warn a user about it.
// Fail
function Component() {
useUnit(someFx)
useEvent(someFx)
useEffect(() => {
someFx()
() => someFx()
}, [])
const callback = () => {
someFx()
}
useCallback(() => {
someFx()
}, [])
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request