P粉6330757252023-09-04 17:05:58
The first component is the component that gets the data, and the second component is the component that displays the data, because you receive user data through props.
function FirstComponent(){ const [user, setUser] = useState([]); return ( <SecondComponent user={user} /> ) } function SecondComponent({user}){ console.log(user) return ( //这里是你展示图片的代码 ) }