preact.render third argument causes weird behavior
See original GitHub issuehttps://codepen.io/laino/pen/XWrMyda?editors=0010 Edit: fixed link.
When using the third “replace node” argument, you won’t get anything at all.
Comment either of those render
and it will work.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:21 (20 by maintainers)
Top Results From Across the Web
Odd behaviour in rendering elements list. · Issue #891 - GitHub
This codepen [1] illustrates a problem I am having in an application. Essentially the desired behaviour is that a list of items is...
Read more >API Reference | Preact
The render function is passed the component's current props and state, and should return a Virtual DOM Element (typically a JSX "element"), an...
Read more >React weird rendering behavior - Stack Overflow
It looks like you're using redux. I think behavior would be more predictable if you connected the component to redux and added the...
Read more >Preact - Releases
Preact - ⚛️ Fast 3kB React alternative with the same modern API. ... batched renders between event handlers, which can cause some strange...
Read more >Documentation - SolidJS · Reactive Javascript Library
The Signal's value starts out equal to the passed first argument ... assume this code is in a component function, so is part...
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
I can do that. In return please try to take your time to actually understand the reported problem before giving an example that has nothing to do with it and is a workaround at best. That was absolutely infuriating.
Again: The problem is that the
replaceNode
doesn’t actually work. Meaning: Not as documented and probably not at all.It’s supposed to either replace the specified node or update it. Instead you get an empty element:
https://codesandbox.io/s/cool-fog-zl4jj
@laino Please re-read our Code of Conduct again. We don’t tolerate passive aggressiveness as it’s in direct violation of our CoC, so we have to flag this. There is never a need to be rude even if commenters may be talking past each other. A good step forward would be to apologize to @JoviDeCroock and than let’s get back onto solving this issue 👍
There does indeed seem to be an issue lurking with the
replaceNode
parameter. Not rendering twice is a valid workaround in the short term, but that’s obviously not a long-term solution.