-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
enhancementNew feature or requestNew feature or request
Description
It can be useful for SSR or SPA with testing approaches.
Should ban direct calls of effector events inside React/Solid components.
Fail:
// no-direct-event-calls-in-components: 'error'
import { somethingHappened } from './model'; // Event
function Example() {
// Should suggest to wrap it with `useEvent` from "effector-react/scope"
return <div onClick={() => somethingHappened()} />
}Okay:
// no-direct-event-calls-in-components: 'error'
import { useEvent } from 'effector-react/scope';
import { somethingHappened } from './model'; // Event
function Example() {
const handleClick = useUnit(somethingHappened);
return <div onClick={() => handleClick()} />
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request