barelyhuman / babel-plugin-mutable-react-state

(WIP) transform mutable variables to react-state
https://barelyhuman.github.io/babel-plugin-mutable-react-state/
MIT License
7 stars 0 forks source link

Limit to react component scope #1

Closed barelyhuman closed 2 years ago

barelyhuman commented 2 years ago

Currently takes any scope with the reactive definition and replaces with the state hooks

While in the most idea condition, this might not break but we don't live in a idea world. SO CHANGE IT.

Notes

barelyhuman commented 2 years ago

Based on the above, check the return statement to be a React.createElement

Creates an issue since, if used in a custom hook function, this wouldn't work... Probably going to ignore this point for now

barelyhuman commented 2 years ago

bacb536179ded9c20f222abfb554046b7ccb7ab0 - add support for arrow functions
de8d33b33ccdd2627ac5507e4937d62d513b0a4c - limit reactive variables to functional scope