
エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
Why is .current null for useRef Hook?
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています

- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Why is .current null for useRef Hook?
I have a simple example of a component: function App() { const observed = useRef(null); console.l... I have a simple example of a component: function App() { const observed = useRef(null); console.log(observed.current); return ( <div ref={observed} className="App"> <h1>Hello CodeSandbox</h1> <h2>Start editing to see some magic happen!</h2> </div> ); } const rootElement = document.getElementById("root"); ReactDOM.render(<App />, rootElement); I would expect that observed.current would be of type e