render or the componentDidMount?render comes first when an instance of a component is being created and inserted into the DOM it occurs during the mounting phase.In the lifecycle of React the first thing that happened is the Mounting,which includes these methods that are called in the following order when an instance of a component is being created and inserted into the DOM:
componentDidMount, render, constructor, componentWillUnmount, React Updates:componentDidMount() is a hook that gets invoked right after a React component has been mounted aka after the first render() lifecycle.(aka properties) in React allows us to pass values from a parent component down to a child component. The values can be any data type, from strings to functions, objects, etc.props allows you to pass into the componants. But the state is handeled inside that componant which is props are handeled outside it.state it can be apdate it inside it’s componant , while the props it’s need to be apdate it outside because it’s located outside the componant.state inside the application.A simple update of the state, from anywhere in the code, causes all the User Interface (UI) elements to be re-rendered automatically.References:
@Joshua Blankenship/React: Component Lifecycle Events
@Web Dev Simplified/React State Vs Props