-
Notifications
You must be signed in to change notification settings - Fork 47k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React preserves duplicates of DOM node on re-render. #11836
Comments
Can you create a minimal example without TypeScript please? Preferably as a jsfiddle. |
Actually, I have already tried to isolate the case, but I failed. In fresh-new react app with |
I found it. I wanted to be able to use Immutable in console, so I exported Immutable to window, but as I experimented with it, I assigned |
Oh I see. Thanks for explaining. We can’t really warn about this: you might intentionally be using a polyfill. |
Hi guys. I'm getting really weird behavior in my latest project. I assume it's a bug in React.
I want to override default browser context menu. I subscribed for
contextmenu
andclick
events incomponentDidMount
. On right click (context menu) I want to show my custom div. On left click, this div should hide. In event listeners I do:and in
render
there's:I assume everybody can imagine expected behavior. But real behavior is:
right click > context menu shows up > left click > context menu is still there > right click > another context menu shows up... and so on... You can literally see DOM nodes being duplicated in Elements tab in DevTools
You can try it here: https://github.com/jake-daniels/zen-tab
The code is in
src/app/controller/NotesBoard.tsx
file.Try
npm install
npm start
, then right/left click somewhere on blue area.Environment:
MS Windows 8.1 x64
Chrome 63.0.3239.84
React 16.2.0
The text was updated successfully, but these errors were encountered: