What are PropTypes in React

What are PropTypes?

How to use PropTypes

npm install prop-types --save
import PropTypes from 'prop-types';
import React from 'react';
import { PropTypes } from "prop-types";

const Count = (props) => {
return (
<>
.........
</>
)
};

Count.propTypes = {
//// key is the name of the prop and
// value is the PropType
}
export default Count;
Count.propTypes = {
// Put props here
}

I am a front-end developer from India with over one year of experience in freelancing with skills like Git, HTML5, CSS3, Bootstrap 4&5, and React.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Coding a Contact Form with Next.js and Nodemailer

I added a video to a @YouTube playlist https://t.co/qXtBeOh4We I Remember

Add a soft ui design to your site (neumorphism)

credit: https://www.pinterest.com/pin/455074737350700472/

What’s the best way to log errors (in Node.js)?

Top 5 Tips for Developing a WordPress Theme

PhaserJS Tutorial for Canvas Graphics with Code Examples and Demonstration

PhaserJS plays like the helicopter game

How to connect rarepress with existing Ethereum wallets

Improving React Performance Using Bulk Processing

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ateev Duggal

Ateev Duggal

I am a front-end developer from India with over one year of experience in freelancing with skills like Git, HTML5, CSS3, Bootstrap 4&5, and React.

More from Medium

An investigative guide to React JS[DOM, Virtual DOM and JSX] Part-V

Introduction to Astro

functional Componnts-ReactJs

The Beginnings of React.JS