keplergl / kepler.gl

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.
http://kepler.gl
MIT License
10.42k stars 1.75k forks source link

React Hooks version #1005

Open donniekerr opened 4 years ago

donniekerr commented 4 years ago

Does your roadmap include re-write using React Hooks/Function Components? It would be much easier to integrate Kepler into our existing apps if it used Hooks.

ibgreen commented 4 years ago

@donniekerr Can you elaborate a bit on why this would be the case? My sense is currently that whether a React component is implemented via functions or hooks should not matter from the component user's perspective?

donniekerr commented 4 years ago

Agree, in the short term. That is why I asked if hooks was on the roadmap.

Many other React ecosystem tool providers are moving to Hooks versions, such as Router, Apollo, etc. Strategically, a re-write to hooks would be inevitable if one started with the current component-based version. Yes, they can live together, but ideally, a hooks architecture would be preferred longer term.

mayteio commented 4 years ago

Are there particular hooks you’re interested in? Interaction with Kepler is mostly done via redux, so you can use ‘useDispatch’ and ‘useSelector’ from ‘react-redux’. I feel any abstraction over the top of that is unnecessary.

Dependency injection hooks would be nice to allow use of components in isolation. Hooks around import/exporting maps might also be nice to haves.

This is also something that could be developed alongside Kepler as a separate package and integrated when it shows benefit, given they are all redux actions and selectors.