-通过 / -执行
Create a hook to tell if it is the first render.
function App() { const isFirstRender = useIsFirstRender() // only true for the first render ...}
普通解法但是bugfree胜于奇技淫巧但是各种bug。
Try it out
Console