Question: Wrapper around Reflex components
See original GitHub issueHi, first of all, thanks for the Re-Flex. It’s really great.
I want to make the panes hide-able and for this reason I tried with a wrapper around Reflex component.
Idea is to have a wrapper around “ReflexElement”, “ReflexSplitter” like:
Main component
<div className="demo-basic-splitter">
<ReflexContainer orientation="vertical">
<Search/>
<Splitter/>
<Details/>
</ReflexContainer>
</div>
Search component
<ReflexElement className="left-pane">
<div className="pane-content">
Search component
</div>
</ReflexElement>
Spliiter component
return (
<ReflexSplitter/>
)
and then to have a onClick event which will show or hide a specific component (e.g. Search, Splitter, Details). Because you are using flex, layout should work. Maybe, also ReflexSplitter can be inside the wrapper component (not in a separate wrapper component).
Problem is, when I use the wrappers Splitter doesn’t work.
Is there a way to achieve this? From your point of view, can this be done? Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (8 by maintainers)
Top Results From Across the Web
24 questions with answers in REFLEX | Science topic
Review and cite REFLEX protocol, troubleshooting and other methodology information ... Does any one know any auditory and optic Tests for mice? Question....
Read more >Reflex Physiology - LA Mission College
Reflexes are automatic, subconscious response to changes within ... ex. Reflexes for eye movement. ... Muscle spindles are wrapped with two types of....
Read more >[Solved] Which component of the reflex arc directly sends an ...
The correct answer option is (d). A neural connection or pathway called the reflex arc is responsible for the generation of faster responses....
Read more >In a reflex arc, there are 5 primary components: receptors
Answer to: In a reflex arc, there are 5 primary components: receptors, {sensory} neurons, integration neurons, motor neurons, and effectors.
Read more >Motor Units and Muscle Receptors (Section 3, Chapter 1 ...
Sometimes the pathway from sensation to action is direct, as in a reflex. ... raising your hand to ask a question), it is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I pull out that codepen to prove what I’m saying above, clicking the button will generate a random color and update the theme of the InnerSplitter element:
ReflexContainer
will clone its children elements in order to inject custom properties which are needed to control the resizing logic.ReflexSplitter
cannot be wrapped because theReflexContainer
needs to know if a child type is a splitter or not in order to handle it properly (you may have 2 contiguous children which are not separated by a splitter). When you wrap a component I didn’t find a way to determine the type of that underlying wrapped component. In addition I don’t see the use case of wrapping aReflexSplitter
: it can be styled purely by custom css and the rest can be handled by events.However I don’t see wrapping
ReflexElement
as a problem. This allows you to encapsulate some rendering and behaviour logic like illustrated in my example above. In that scenario you need to propagate the injected properties to theReflexElement
. You could pass them one by one by looking at their name in the code, but an easier way is to use{...this.props}
which will blindly pass them to theReflexElement
.