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
It's a good practice to annotate React' Props/State types as $ReadOnly, preventing mutation.
Props can not be mutated in React and doing so could lead to unexpected behavior. State can be mutated but is recommended against, since it's not safe with multiple consecutive calls. There's a lint rule to catch the latter but it's very rudimental and doesn't handle all cases.
@gajus I guess it could also be in eslint-plugin-react. It doesn't have any Flow-related rules at the moment and eslint-plugin-flowtype doesn't have any React-related rules at the moment :)
It's a good practice to annotate React' Props/State types as $ReadOnly, preventing mutation.
Props can not be mutated in React and doing so could lead to unexpected behavior. State can be mutated but is recommended against, since it's not safe with multiple consecutive calls. There's a lint rule to catch the latter but it's very rudimental and doesn't handle all cases.
I don't know if adding React-specific rules is OK in this plugin, but I wanted to throw this idea before making a custom lint rule in our codebase.
The text was updated successfully, but these errors were encountered: