|
@@ -2,15 +2,23 @@ import { useState } from 'react';
|
|
|
import './App.css';
|
|
import './App.css';
|
|
|
import LearnUseState from './components/LearnUseState';
|
|
import LearnUseState from './components/LearnUseState';
|
|
|
import LearnUseEffect from './components/LearnUseEffect';
|
|
import LearnUseEffect from './components/LearnUseEffect';
|
|
|
|
|
+import LearnUseRef from './components/LearnUseRef';
|
|
|
function App() {
|
|
function App() {
|
|
|
- let [show,isShow] = useState(true);
|
|
|
|
|
|
|
+ let [show, isShow] = useState(true);
|
|
|
|
|
+ let [open, isOpen] = useState(true);
|
|
|
return (
|
|
return (
|
|
|
<div className="App">
|
|
<div className="App">
|
|
|
<LearnUseState></LearnUseState>
|
|
<LearnUseState></LearnUseState>
|
|
|
{
|
|
{
|
|
|
- show ? <LearnUseEffect></LearnUseEffect> : <div>已卸载</div>
|
|
|
|
|
|
|
+ show ? <LearnUseEffect></LearnUseEffect> : <div>已卸载</div>
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ <div className='main'>
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+ open ? <LearnUseRef></LearnUseRef> : <div>已卸载</div>
|
|
|
|
|
+ }
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|