solidjs-community / eslint-plugin-solid

Solid-specific linting rules for ESLint.
MIT License
216 stars 26 forks source link

solid/reactivity: Context provider value prop should not be a tracked scope #33

Closed joshwilsonvu closed 1 year ago

joshwilsonvu commented 1 year ago

Noticed this in a Discord message, see the docs for confirmation: https://www.solidjs.com/docs/latest/api#createcontext

Much like event handler props like onClick, it turns out the value prop of a context Provider component does not react to changes. The docs say that one "should pass in Signals and Stores directly instead of accessing them in the JSX". solid/reactivity should exempt this case from being considered a tracked scope, and warn when reactive variables are accessed in the JSX.