Preact: Not replacing the elements inside render container at first rendering

Created on 22 Jun 2019  路  3Comments  路  Source: preactjs/preact

React documentation says that:

ReactDOM.render() controls the contents of the container node you pass in. Any existing DOM elements inside are replaced when first called.

But in preact the content is not replaced, here is a running example:

https://codesandbox.io/s/replace-content-of-container-fcrf4

Most helpful comment

Awesome, thanks for posting 馃憤 We could destroy the DOM just in compat, that sounds easy enough 馃挴

All 3 comments

same conversation as #1718; preact is not constrained to the ReactDOM.render() api definition and can operate differently. Is that good? in my opinion "no", but there's a history why it's never been the same

Oops, my bad, thanks for link the conversation :wink:

Awesome, thanks for posting 馃憤 We could destroy the DOM just in compat, that sounds easy enough 馃挴

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mizchi picture mizchi  路  3Comments

matthewmueller picture matthewmueller  路  3Comments

k15a picture k15a  路  3Comments

philipwalton picture philipwalton  路  3Comments

kossnocorp picture kossnocorp  路  3Comments