useId

2024/4/13 15:53:38

react-useId

// App.tsx const id Math.random();export default function App() {return <div id{id}>Hello</div> }如果应用是CSR&#xff08;客户端渲染&#xff09;&#xff0c;id是稳定的&#xff0c;App组件没有问题。 但如果应用是SSR&#xff08;服务端渲染&#xff…