import React,{Component} from 'react';
import propTypes from 'prop-types';
class TodoItem extends Component{
render(){
return(
<div>
<p>{this.props.todo.title}</p>
</div>
)
}
}
//proptypes used for what type of data need to be render out there in your code🔽🕶
TodoItem.propTypes={
todo:propTypes.object.isRequired
}
export default TodoItem;
Mostly propTypes used to for rendering correct data means when you have to render number/object/array at that particular instance of code then you can do that thing by using propTypes. and that's all i know. and most important below🔽🔧 and if you have something more then please comment🔽
Mostlyall developers including big youtubers
they use this&done mistake👉 import PropTypes from 'prop-types';
but for avoiding the errors we have to use 🔽
import propTypes from 'prop-types';
use propTypes and find issue related this hereClickMe🕶
Stay safe/clean God bless you all
follow Me On twitter