Popup: triggers that do not spread props do not work
See original GitHub issueSteps
- Create a stateless component.
- Pass it to
Popup
as thetrigger
prop.
Expected Result
Get the popup when mousing over the trigger
component.
Actual Result
Don’t get a popup when mousing over the trigger
component.
Version
0.64.2 (master)
Testcase
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Passing props to reactjs-popup component - Stack Overflow
For the Modal I use reactjs-popup, eveything works fine only the title and image do not appear. modal image. This is where I...
Read more >Why I stopped spreading props on React Components
Explicit is better than implicit. In conclusion, while spreading props is a powerful pattern we must be aware of its drawbacks and conscious ......
Read more >Build a POPUP component in React JS - YouTube
Learn how to build a popup component for React JS by using React Hooks and functional components. We build a timed popup that...
Read more >Controlling tooltips & pop-up menus with components in React
Also, it is required to pass the open() function to <Select> component as a prop so that when the selected element is clicked,...
Read more >material-ui-popup-state - npm
The id for the popup component. It will be passed to the child props so that the trigger component may declare the same...
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
It is best practice to consume handled props and pass the rest along, which is what is required for the trigger to work. Here is a fork that shows the necessary changes:
http://codepen.io/levithomason/pen/QdpvRm
That said, this actually confused me at first as well. So, it is at the least unintuitive. I believe we can make this work for custom components that do not consume their props and pass the rest. I’ll leave this issue open for that work.
@neutraali can you please create a new issue with a repro if you faced an issue that can’t be fixed with this comment (https://github.com/Semantic-Org/Semantic-UI-React/issues/1187#issuecomment-273988903)?