export default function Example() { const [name, setName] = useState(""); return (<div>Example</div>);}我想導(dǎo)出 {name},因為我將在另一個組件上使用它。我只能使用全局狀態(tài)(Context API 或 Redux)來完成它,或者有一種方法可以輕松導(dǎo)出在另一個導(dǎo)出中呈現(xiàn)的 var {name} 嗎?
有沒有辦法通過導(dǎo)出函數(shù)傳遞數(shù)據(jù)?
慕容3067478
2023-04-01 15:04:19