question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

preact.render third argument causes weird behavior

See original GitHub issue

https://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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:21 (20 by maintainers)

github_iconTop GitHub Comments

7reactions
lainocommented, Aug 26, 2019

Please do not use passive-aggressive language

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

3reactions
marvinhagemeistercommented, Aug 27, 2019

Please do not use passive-aggressive language

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.

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found