Comments (2)
The listener was attached and removed in those lifecycle events (47019f3#diff-fae640c3677d082e033cc3beb0c626ceL72), but I moved them per this comment #60 (comment). Maybe I put them in the wrong place, but my read on that comment was that the listeners should not be attached or removed inside componentDidMount
and componentWillUnmount
anymore. If there's a way to address that comment without moving out of those two lifecycle events, I could use some help implementing.
from mr-ui.
Sorry, I meant componentDidUpdate
... 🤦♂️
In componentDidUpdate
we'd say "Was the menu previously closed but is now open? If so, attach an event listener. Was the menu previously open but is now closed? If so, detach the event listener." And in componentWillUnmount
we'll always detach the event listener — this change we should make regardless. This way we'd avoid triggering side effects from the render method.
That said, the other alternative to consider is keeping the event listeners where they were (attach only on mount, detach on unmount) but only having one test case.
from mr-ui.
Related Issues (20)
- Drop Underreact HOT 1
- Rewrite modal component
- Rewrite popover component HOT 1
- Rewrite controlled-accordion component
- Rewrite control-select using radix select HOT 2
- Remove components that are not needed HOT 2
- Rewrite tabs components using Radix tabs HOT 2
- Plan to migrate components to Radix HOT 1
- Rewrite non radix components
- Rewrite radio/checkbox components HOT 1
- Rewrite range component
- Rewrite control-label component
- Rewrite icon-text component
- Rewrite loader components
- Configure npm build to reference absolute paths
- Allow the `children` prop to be optional HOT 1
- Cursor Jumps to end of input after component is remounted
- Tooltip/Popover component shouldn't require components to be wrapped in HTML markup
- Calls to getWindow() prevent successful use in SSR HOT 2
- Button as child of .prose has blue text
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mr-ui.