Open kimkanu opened 5 years ago
It does not seem so that the relevant component exits, Does this happen on React?
I expect there should be -enter(-active)
classes when a component is entering.
React version: https://github.com/kimkanu/preact-transition--react (https://kimkanu.github.io/preact-transition--react/) Preact version: https://github.com/kimkanu/preact-transition--preact (https://kimkanu.github.io/preact-transition--preact/)
In the React version, the fade and translate effects occur while entering. However, they don't appear in the Preact version. Weirdly exit animations occur in both examples.
Thanks for the two repos :tada: They're awesome and help a lot in narrowing the issue down. So far I was able to step through the source of react-transition-group
and it fails to apply the enter-*
classes. This happens because findDOMNode()
returns null
and not the expected DOM node. The entering classes are set inside the componentDidMount
lifecycle hook. In Preact speak we're not setting _dom
and c.base
correctly there. Will need to investigate further.
Okay, I think I have a good understanding of what's happening here. The problem is that componentDidMount
is called before the DOM has been updated completely. It's a difficult problem and I have the feeling that this is not just a small fix, but a more involving issue. Not sure if that would make it into the initial X release.
Hi! Any updates on this?
try removing switch, it works i removed the StrictMode to get rid of the warning about findDOMNode() and also removed Switch and now its working
react-transition-group
is partially not working with Preact X.I've created a Preact project with
preact-cli
bypreact create typescript test (--yarn)
(with typescript template), installedpreact@next
and upgraded other packages:After replacing
preact-router
byreact-router(-dom)
, I've changed some codes accordingly.app.tsx:
Then
-exit(-active)
works while-enter(-active)
doesn't.Is there anything I'm missing?