Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

168
Views
What's wrong with using object as a PropType?

I see that Airbnb's style guide includes forbid-prop-types for type object. (as can be seen here)

Can someone explain why I would want to forbid the use of PropType.object?

Is it just that it's too vague? And if so, how can I be more specific?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Is it just that it's too vague?

Yes

And if so, how can I be more specific?

Basically, they're saying if you use object you should really be using shape so you can specify what the key/values of the object are.

 // An object taking on a particular shape
  myObject: React.PropTypes.shape({
    color: React.PropTypes.string,
    fontSize: React.PropTypes.number
  }),
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!