Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Css transition classNames get removed by react updates, if child has 'className' props #854

Open
icy0307 opened this issue Sep 26, 2022 · 0 comments

Comments

@icy0307
Copy link

icy0307 commented Sep 26, 2022

What is the current behavior?

CSSTransition add classname to child component by dom API directly, not by react.
If react updates after CSSTransition adding class, CSSTransition's class names ,like 'enter-done', get removed by react props.

const [showClassNames, setshowClassNames] = useState(false);
<CSSTransition nodeRef={nodeRef} in={inProp} timeout={200} classNames="my-node">
        <div 
           ref={nodeRef}
           className={showClassNames? "anyClassName": ""}
           onClick={() => {setshowClassNames(true)}
         >
          {"I'll receive my-node-* classes"}
        </div>
</CSSTransition>

What is the expected behavior?

CSSTransition's class names remains , even if child component updates with class

Could you provide a CodeSandbox demo reproducing the bug?

https://codesandbox.io/s/morning-pond-xu2e9l

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant