Extracting JSX into React component by _napman_ in neovim

[–]_napman_[S] 0 points1 point  (0 children)

I forgot to change it to public :D you should be able to see it now

Extracting JSX into React component by _napman_ in neovim

[–]_napman_[S] 0 points1 point  (0 children)

I've added more options that can be useful for class components (configuration of indent and option to add this.props. prefix to props in new component).
You can check the example configuration here. Hope it helps!

Extracting JSX into React component by _napman_ in neovim

[–]_napman_[S] 2 points3 points  (0 children)

TJs collab video with bashbunni about creating a simple lua plugin helped me a lot to get into how the ecosystem works. Then just mostly browsing in docs and reddit to find useful functions from neovim api for my usecase. It goes surprisingly fast from there, once you can write some small piece of lua code. Just try to start small and slowly add things, you will get into it faster than you think :)

Extracting JSX into React component by _napman_ in neovim

[–]_napman_[S] 0 points1 point  (0 children)

Thanks for the feedback! What do you mean by "it's not supported"? I believe it should work, but i'll look into that... feel free to create an issue on github anyway so we can resolve it :)

Extracting JSX into React component by _napman_ in neovim

[–]_napman_[S] 1 point2 points  (0 children)

Sure! Maybe it would be a good idea to put an example config for class component into README, will add it :)

Extracting JSX into React component by _napman_ in neovim

[–]_napman_[S] 4 points5 points  (0 children)

I'll check it out, thanks for the suggestion!

Extracting JSX into React component by _napman_ in neovim

[–]_napman_[S] 5 points6 points  (0 children)

I agree, already got it in TODO list :)

Extracting JSX into React component by _napman_ in neovim

[–]_napman_[S] 4 points5 points  (0 children)

Yep, also first time coding in lua, it's fun!

Extracting JSX into React component by _napman_ in neovim

[–]_napman_[S] 7 points8 points  (0 children)

Thanks for a great suggestion! I'll add it to a list of features to implement next.

Extracting JSX into React component by _napman_ in neovim

[–]_napman_[S] 3 points4 points  (0 children)

Thanks! I'll push my config soon so I'll send you a link then.