Skip to main content
The Deno 2 Release Candidate is here
Learn more
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function checkPropTypes
import { checkPropTypes } from "https://deno.land/std@0.40.0/types/react/prop-types.d.ts";

Assert that the values match with the type specs. Error messages are memorized and will only be shown once.

Parameters

typeSpecs: any

Map of name to a ReactPropType

values: any

Runtime values that need to be type-checked

location: string

e.g. "prop", "context", "child context"

componentName: string

Name of the component for error messages

optional
getStack: () => any

Returns the component stack