Single Wrapper, multiple Components
See original GitHub issueHi, I would like to have two images side by side that share the same TransformWrapper
.
The idea is that zooming or panning on one of the images also affects the scale and translation of the other.
If I put two TransformComponent
s in the same TransformWrapper
, I can only pan and zoom on the second one, although the effect are correctly applied to both components.
Having a quick look at the code, it seems that it’s because a TransformWrapper
only expects to have a single TransformComponent
inside.
Is there a way to enable the events also on the first image?
The following is the pseudocode of my current approach:
<TransformWrapper>
<Row>
<LeftCol>
<TransformComponent>
<Image1 />
</TransformComponent>
</LeftCol>
<RightCol>
<TransformComponent>
<Image2 />
</TransformComponent>
</RightCol>
</Row>
</TransformWrapper>
Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
How To Create Wrapper Components in React with Props
In this tutorial, you'll create wrapper components with props ... to a single prop; you can pass elements to as many props as...
Read more >How to organize one React component with different wrapper ...
I am looking for a better, more elegant solution. I've tried sending the wrapper components to the Item but React doesn't allow to...
Read more >How to Wrap One React Component into Another | Pluralsight
High-Level View Of HOCs. HOC design pattern is applied by many modules as a way of inserting functionality from the module into the...
Read more >React tutorial for beginners 2021 - Understanding Wrapper ...
In this tutorial video I talk about what Wrapper Components are and how you use ... It's a lengthy video on the topic,...
Read more >Using Wrapper Components in React | Tutorial - YouTube
In this video you will see how to use Wrapper Components in React.I hope this video can help you. ... Learn more. Switch...
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
@sgentry I ended up writing the following:
you’re perfect, @bmanga ❤️