File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -72,25 +72,23 @@ export const EXITING = 'exiting'
7272 * begins the "Enter" stage. During this stage, the component will shift from
7373 * its current transition state, to `'entering'` for the duration of the
7474 * transition and then to the `'entered'` stage once it's complete. Let's take
75- * the following example:
75+ * the following example (we'll use the
76+ * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
7677 *
7778 * ```jsx
78- * state = { in: false };
79- *
80- * toggleEnterState = () => {
81- * this.setState({ in: true });
82- * }
83- *
84- * render() {
79+ * function App() {
80+ * const [inProp, setInProp] = useState(false);
8581 * return (
86- * <>
87- * <Transition in={this.state.in } timeout={500}>
82+ * <div >
83+ * <Transition in={inProp } timeout={500}>
8884 * {state => (
8985 * // ...
9086 * )}
9187 * </Transition>
92- * <button onClick={this.toggleEnterState}>Click to Enter</button>
93- * </>
88+ * <button onClick={() => setInProp(true)}>
89+ * Click to Enter
90+ * </button>
91+ * </div>
9492 * );
9593 * }
9694 * ```
You can’t perform that action at this time.
0 commit comments