glennflanagan / react-collapsible

React component to wrap content in Collapsible element with trigger to open and close.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suggestion: Refactor library into a modernized approach in a new major version

iMoses opened this issue · comments

I made a very optimized headless hook version of your library to use in my projects and I wanted to check if you'd like to use the code (or work together to produce something similar). I did remove the ARIA part which can be easily added back in if and when it comes to it.

https://gist.github.com/iMoses/24b9dd6e13a26145a919127d38f8c088

Let me know what you think. If you're not interested I can open a separate package for it, just thought it's worth asking since it is technically your logic and the library could benefit from a new major refactor. I think it's always better to improve the existing options then provide more and more of them :)

commented

@iMoses This is brilliant.

This is exactly the direction I wanted to steer react-collapsible. I wonder if @glennflanagan feels the same way?

@glennflanagan What are you thoughts? Would you be happy in making iMoses a contributor? We could create a v3 branch to do some extensive tests on it.

Yes that is really nice - if we can do the hook version alongside the old class way of doing it too that'd be amazing.

I definitely don't have the time to implement something like this - and the amount of work would feel like it'll end up a completely different project. What do you think @karltaylor?

commented

Yeah I agree with keeping it classes. I think we could collaboratively work on this over next coming months. Perhaps open up a discussions on this repo and ask for some extra helping hands from the community?

Discussion open here #234

Seems like you forgot about it completely, but my suggestion still stands...