Component Lifecycle

Initialization

image

State Changes

State changes will trigger a number of methods to hook into.

image

componentDidMount = Where you do DOM manipulation & AJAX requests. Kind of like a boot loader for your react component. AJAX requests should be done here, and NOT in componentWillMount

componentWillUnmount = Clean up after your React component gets destroyed This is where you remove event listeners, DOM changes, etc that you likely defined in componentDidMount

Props Changes

Any changes on the props object will also trigger the lifecycle and is almost identical to the state change with one additional method being called.

image

results matching ""

    No results matching ""