React is declarative.

Q. What is declarative vs imperative?

Ans. The imperative programming paradigm: “After exiting Port Authority, head southwest on 8th Ave toward W 41st St, turn left onto W 33rd St and you should arrive on Penn Station.”

The declarative programming paradigm: “Penn Station is located at 7th & 8th Avenues, between 31st & 33rd Streets New York, NY 10001”

As you can see, the first example lists out the directions step by step, hence indicative of an imperative approach. The second example merely describes the end location/result with an address, disregarding how the traveler/user might get there.

Imperative Example:

function addArtistNameToBody() {  
	const bodyTag = document.querySelector('body')  
	const divTag = document.createElement('div')  
	let h1Tag = document.createElement('h1')  
	h1Tag.innerText = "Mitski"  
	divTag.append(h1Tag)  
	bodyTag.append(divTag)  
}

Declarative Example:

class Artist extends Component {  
	render() {  
		return(  
		<div>  
		<h1>{this.props.name}</h1>  
		</div>)  
	}  
}