Skip to content

Instantly share code, notes, and snippets.

@eggplants
Created April 18, 2022 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eggplants/a2039782cd1846e0620be183a6497788 to your computer and use it in GitHub Desktop.
Save eggplants/a2039782cd1846e0620be183a6497788 to your computer and use it in GitHub Desktop.
クラスコンポーネント 関数コンポーネント
constructor(props) 関数コンポーネントの引数をpropsとして受け取る
render() 関数コンポーネントの返り値
componentDidMount() useEffect(() => {...})
componentDidUpdate() useEffect(() => {...}, [...])
componentWillUnmount() useEffect(() => {return () => {...}})
this.state = {...} const [v, setV] = useState(initV)
this.setState({...}) 上行 + setV(...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment