Replies: 1 comment 5 replies
-
@evanSe I'm thinking about the data mutability issue. In order to make the wrapper actually feel idiomatic in React, we should not only make sure the data isn't mutated, but also make sure the only way to get the changed data will be via The simple solution could use deep copy of I proposed using Immer, but it doesn't seem to be feasible just within the React wrapper as the data mutation happens quite deep in HOT Core and there's no easy way to plug in there and this would probably be too breaking anyway. How about we use This will end up not applying the change to the grid unless the user hooks it back via Also, we can think of a "legacy"/"non-managed" mode, for example when someone doesn't provide |
Beta Was this translation helpful? Give feedback.
-
We are on a mission to make the React developer experience next level - Handsontable should be a seamless addition to your React application and we have some great ideas on how to achieve just that.
How can you contribute?
We invite you to share your experiences, pose questions, correct our assumptions, and showcase your unique use cases. Dive into the ideas outlined in the RFC, and embark on this exciting journey with us! 🚀
Goals
Our objectives for the overhaul include:
Improving the Renderer/Editor experience
Specifying renderers and editors as children components marked with "magic" (
hot-renderer
,hot-editor
etc.) attributes does not feel idiomatic. They don't represent something that is a part of the column, it's purely the column's property. Moreover, this kind of composition allows putting multiple Renderers and Editors in one column, which is illogical.Instead, we're proposing to use a variant of render props pattern and allow specifying component-based renderers/editors via HotTable or HotColumn props directly. The awesome part of this approach is we can keep things heavily typed in regards to typescript, it is the preferred approach when it comes to proper React and involves less magic behind the scenes.
Functional components and context
We're planning to get rid of the class-based approach in favor of functional components. The data between HotTable and HotColumns will no longer be passed via component cloning and children manipulation - React context will be used instead.
Currently, we are planning to keep this context private, although there could be some great use cases to expose it, we would love to know!
Other changes we are planning
Beta Was this translation helpful? Give feedback.
All reactions