AmanNegi / FreshNest

A platform that connects local producers directly with consumers seeking fresh produce.
https://fresh-nest.netlify.app
GNU Affero General Public License v3.0
23 stars 39 forks source link

Chore: Add PropTypes to components in React #177

Closed AmanNegi closed 7 months ago

AmanNegi commented 8 months ago

Issue Description

Currently, we do have the prop-types imported in our package.json however we do not use it to define the prop types for our components. It would be nice & type safe, if they could be added for each component.

It's possible that if the PR gets too large this can be divided into two separate PR's.

Saran-pariyar commented 8 months ago

I want to do it.

Should I start adding propType like this in every component and page? Anything other that I should consider? Thanks.

image

AmanNegi commented 8 months ago

Sure, @Saran-pariyar Welcome to FreshNest. Yes that's exactly what we want to do, you will find the places where prop-types as errors through eslint.

npm run lint

This will list all the places where prop-types are needed. Let me know if something else is needed. :sparkles: :smile:

AmanNegi commented 7 months ago

Fixed via https://github.com/AmanNegi/FreshNest/pull/197