The first iteration of this library was a hook-based API, with the idea that it would allow implementors more freedom to control the markup output by react-resplit. There were some challenges with this approach, given that the methods to register the container, panes and splitters all came from the core useResplit hook, which meant that it was harder to control the mounting and unmounting of the individual elements.
This PR, and version v1.0.0 of react-resplit, replaces the hook-based API with a compound component API. Each of the resplit elements e.g. Root, Pane and Splitter, extend div elements at the moment, but in a future iteration an asChild prop, based on the Radix UI composition technique, may be introduced to provide more flexibility there.
The first iteration of this library was a hook-based API, with the idea that it would allow implementors more freedom to control the markup output by react-resplit. There were some challenges with this approach, given that the methods to register the container, panes and splitters all came from the core
useResplit
hook, which meant that it was harder to control the mounting and unmounting of the individual elements.This PR, and version
v1.0.0
of react-resplit, replaces the hook-based API with a compound component API. Each of the resplit elements e.g. Root, Pane and Splitter, extenddiv
elements at the moment, but in a future iteration anasChild
prop, based on the Radix UI composition technique, may be introduced to provide more flexibility there.