📅  最后修改于: 2022-03-11 15:02:07.590000             🧑  作者: Mango
jsximport { useEffect, useState } from 'react';function MyComponent({ prop }) { const [state, setState] = useState(''); useEffect(() => { // Runs ONCE after initial rendering // and after every rendering ONLY IF `prop` or `state` changes }, [prop, state]);}