[Feature] Add ReactDOM.renderSync(...) method
See original GitHub issueDo you want to request a feature or report a bug? feature
What is the current behavior?
ReactDOM.render(...)
is an async operation
What is the expected behavior?
Would be very nice if there was something like ReactDOM.renderSync
method that would interrupt all pending operations and render the Element
and put it in DOM
immediately.
Very critical for my current use case (willing to explain if need be)
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
16.x.x
Issue Analytics
- State:
- Created 5 years ago
- Comments:20 (9 by maintainers)
Top Results From Across the Web
ReactDOM
The react-dom package provides DOM-specific methods that can be used at the top ... It may be possible to insert a component to...
Read more >How do I do a synchronous ReactDOM.render
You can pass a callback to ReactDOM.render(ReactElm, DOMNode, callback) . The callback will be executed once the ReactElm gets loaded into ...
Read more >Managing DOM components with ReactDOM
Learn to expertly manage DOM components in a React app, including a deep dive into each ReactDOM method, with this comprehensive tutorial.
Read more >A Closer Look at ReactDOM.render - The Need to Know ...
ReactDOM is a package that provides methods that can be used to interact with the DOM, which is needed to insert or update...
Read more >ReactJS | ReactDOM
This is one of the most important methods of ReactDOM. This function is used to render a single React Component or several Components ......
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 Free
Top 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
It seems like createPortal is exactly what you want?
Question on this maybe @jquense or @gaearon can answer; is
ReactDOM.createPortal(...)
synchronous?It doesn’t accept a callback function, and when I check the container element (via debugging), the provided React node has not been added into the container.
Is there anyway I can listen for when the node has been placed into the container? Code below