Report reactivity issues when using inside solid-start routeData
function
#43
Labels
enhancement
New feature or request
reactivity v2
To be addressed in the rewrite of the solid/reactivity rule
Describe the need
I really like this plugin - it's a must-have for my solid.js projects.
I use solid-start and I had a problem that
routerData
not being called reactively because I did break reactivity.I believe that this rule can prevent such cases.
Notice - I am still not confident enough to identify when Solid.js lose reactivity (this is why I think this plugin is important) so I hope this would help me and other users prevent mistakes.
Suggested Solution
Adding an exception to the rule that it would work in
routerData
function and treat it like a componenthttps://github.com/solidjs-community/eslint-plugin-solid/blob/main/src/rules/reactivity.ts#L390
Possible Alternatives
Maybe add config with functions that should be reactive
Additional context
This is the original function I had that did not update on date change.
NOT WORKING - not reactive when
date
changesAnd I end up doing something like
WORKING - reactive and called again when
date
changesI can try adding exceptions to function declarations that have the name
routerData
in https://github.com/solidjs-community/eslint-plugin-solid/blob/main/src/rules/reactivity.ts#L390 even if they don't contain jsx and maybe this is a good direction to start.The text was updated successfully, but these errors were encountered: