prop-types

Runtime type checking for React component props, warning in development when data doesn't match the declared shape.

Library
npm
v15.8.1
4,448stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
40/100Fair
Development Activity0
Maintenance0
Community60
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
81/100Excellent
Architecture80
Code Quality75
Innovation85
Learning Curve85

prop-types is Facebook’s standalone runtime type-checking library for React component props, extracted from React core in 2017 so it could evolve independently of React’s release cycle and be reused by libraries beyond React itself.

It lets you declare the expected shape of a component’s props using composable validators (strings, numbers, shapes, arrays of a type, unions, and more), then warns in the console during development whenever a parent passes data that doesn’t match — without adding any overhead to production builds.

What You Get

  • Primitive validators for array, bool, func, number, object, string, symbol, and bigint prop types.
  • Composable validators like arrayOf, objectOf, shape, exact, oneOf, and oneOfType for structured or constrained data.
  • React-aware validators for node, element, and elementType, covering anything renderable or component-like.
  • A production-safe checkPropTypes() API for validating props manually outside of a component’s own propTypes.

Common Use Cases

  • Documenting and enforcing the expected shape of props on shared or public React components.
  • Catching integration bugs early in development when a parent passes the wrong data type to a child component.
  • Validating props on plain JS objects using PropTypes.checkPropTypes() outside of React’s normal render cycle.

Under The Hood

Architecture - index.js branches on NODE_ENV to load one of two factories: factoryWithTypeCheckers.js (development) builds the full set of validator functions with warnings, while factoryWithThrowingShims.js (production) swaps in shims that are no-ops unless called directly, in which case they throw to prevent accidental production use. factory.js is a separate legacy-compat entry point that always returns the full type-checker factory regardless of environment, preserving behavior for old React versions (<=15.5) that expect validators to be callable directly. checkPropTypes.js implements the shared validation loop: it iterates a component’s typeSpecs, invokes each validator with a secret token (lib/ReactPropTypesSecret.js) that authorizes internal React calls while blocking direct end-user invocation, and memoizes each unique failure message in loggedTypeFailures so repeated renders don’t spam the console.

Tech Stack - Plain ES5 CommonJS JavaScript with no TypeScript and no ESM build. Three runtime dependencies: react-is (element/type detection), object-assign (an Object.assign ponyfill for older engines), and loose-envify (a transform that dead-code-eliminates the NODE_ENV branches during bundling). Dev tooling is Jest for tests, ESLint for linting, and Browserify plus UglifyJS for producing the CDN UMD bundles (prop-types.js / prop-types.min.js) — the npm-published CommonJS source itself ships unbundled.

Code Quality - The tests directory contains four large suites (PropTypesDevelopmentReact15.js, PropTypesDevelopmentStandalone-test.js, PropTypesProductionReact15-test.js, PropTypesProductionStandalone-test.js) totaling roughly 4,600 lines of tests against ~600 lines of source in factoryWithTypeCheckers.js — an unusually high test-to-source ratio that reflects the combinatorial surface of validator types crossed with required/optional and dev/prod/legacy variants. There’s no TypeScript and no formal error-code system, just hand-written message strings, but the codebase is small and single-purpose enough that this is a minor tradeoff. GitHub activity is low (last commit May 2024) — consistent with a stable, feature-complete primitive rather than an abandoned project.

API Design - Usage is zero-config: import PropTypes and assign validators to a component’s propTypes object. The chainable .isRequired modifier and composable builders (shape({…}), arrayOf(PropTypes.number), oneOfType([…])) read close to natural language, and failures are non-fatal, dev-only console warnings, deduplicated per message. Its one sharp edge — validators throw if called directly outside of checkPropTypes, a deliberate change from the old React.PropTypes gated by a secret token — is clearly documented in the README’s migration section.

Used by 45 apps in this directory

Python
99%
MIT

Agent Lightning

AI Development

17,500

A Microsoft-built training framework that optimizes AI agents with reinforcement learning, automatic prompt optimization, or supervised fine-tuning — with near-zero code changes to your existing agent, in any framework.

View details
84
Repo Health
68
Technical
69
Dependency
Built with
Python99%
Updated today
TypeScript
66%
Apache 2.0

Appsmith

Developer Tools · Automation · No Code Platforms

40,707

Open-source low-code platform to build admin panels, dashboards, and internal tools connected to any database or API.

View details
94
Repo Health
79
Technical
68
Dependency
Built with
TypeScript66%
Java22%
Updated today
Go
85%
Apache 2.0

Argo Workflows

Devops · Data Engineering

16,916

The most popular Kubernetes-native workflow engine for orchestrating containerized DAGs, ML pipelines, CI/CD, and parallel batch jobs at scale.

View details
96
Repo Health
90
Technical
70
Dependency
Built with
Go85%
TypeScript11%
Updated today
Rust
86%
Other

Arroyo

Data Engineering · Analytics

5,005

A distributed stream processing engine written in Rust that lets you write SQL to run stateful, real-time computations over data streams with subsecond results.

View details
86
Repo Health
74
Technical
62
Dependency
Built with
Rust86%
Updated 1 weeks ago
TypeScript
97%
AGPL 3.0

Bigcapital

Invoicing Finance

3,846

Self-hostable double-entry accounting platform with invoicing, inventory, multi-currency, and real-time financial reporting for small and medium businesses.

View details
91
Repo Health
77
Technical
64
Dependency
Built with
TypeScript97%
Updated yesterday
JavaScript
99%
Other

ChartBrew

Analytics · Databases

4,041

Open-source reporting platform to build live dashboards from SQL, NoSQL, APIs, and SaaS tools with an AI assistant that creates charts from natural language.

View details
90
Repo Health
83
Technical
65
Dependency
Built with
JavaScript99%
Updated 6 days ago
TypeScript
53%
Other

Chaskiq

CRM · Customer Support

3,560

Self-hosted live chat, video calls, help center, and marketing automation — a full-stack Intercom alternative you run on your own infrastructure.

View details
60
Repo Health
66
Technical
68
Dependency
Built with
TypeScript53%
Ruby36%
Updated 1 months ago
Java
48%
Apache 2.0

ClearFlask

Product Management · Community

448

Open-source feedback management and roadmap tool that lets product teams collect, prioritize, and respond to user input — with AI-powered summarization and full self-hosting control.

View details
83
Repo Health
73
Technical
63
Dependency
Built with
Java48%
TypeScript47%
Updated 2 weeks ago
JavaScript
53%
Other

Cosmos-Server

Security · Authentication

6,121

All-in-one self-hosted home server with SmartShield anti-DDoS, Nebula mesh VPN, automatic HTTPS, and a 250-app marketplace — all secured behind a unified auth layer.

View details
79
Repo Health
59
Technical
66
Dependency
Built with
JavaScript53%
Go43%
Updated yesterday

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search