display:none) 在其父组件之一的状态更改后可见, 就像向下滑动一样。
我是新的动画部分, 我正在尝试 this_link .
到目前为止我在沙箱中尝试的内容 ( https://codesandbox.io/s/0xrjp051pp ).
I want to slide a stateless component, which will be initially set to
display:none, to be visible after state change in one of its parent component, as if it is slide down just like a dropdown.
I am new to animation part, I was trying out this_link.
So far what i tried in Sandbox (https://codesandbox.io/s/0xrjp051pp).
Can someone help on this?
这是修改后的沙箱, 过渡工作。 https://codesandbox.io/s/nrz8vlmrrl 您需要解决的唯一问题是 CSS 代码, 使其能够正常工作.
- 更改了 CSS 中的转换类以显示组件。它有显示: 以前没有.
- 显示和隐藏组件基于所传递的道具, 但不使用组件
Here is the modified Sandbox with the transition working. https://codesandbox.io/s/nrz8vlmrrl The only thing that you need to fix is the CSS code to get it to work a desired.
The changes I made are as follows.
- Changed the transition class in CSS to display the component. It had display:none previously.
- Show and hide the component based on the prop that you were passing but not using in your component