Closed aminya closed 1 year ago
Yes, I'd welcome a change to make solid/reactivity
accept static
as a prefix wherever initial
and default
are used. I think that's a good solution as static
would be visible to the caller to help prevent accidentally passing a reactive value to these props.
In the future I could envision the rule actually warning on staticProp={signal()}
in the call site. I assume you have no problem with that? But let's just do what you suggested for now.
Describe the need
props
in Solid components can be both reactive and also static. The current rules, especially,solid-js/reactivity
gives warnings on the static usage of props. When I assign props to a constant or destructure it, I meant to make the property constant. However, the plugin detects that as an error.Suggested Solution
I would like to see a
static
prefix to be added to the list of ignored props for this warning. The following should be ignored because of thestatic
prefix.Possible Alternatives
There's no way to indicate this other than using
eslint-disable
or usinginitial/default
prefixes. Both are undesirable for my intention.Additional context