Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error (checkPropTypes is not a function) while using with sveltekit #378

Open
code-masala opened this issue Apr 4, 2022 · 1 comment
Open

Comments

@code-masala
Copy link

	import * as PropTypes from "prop-types";
	const {checkPropTypes, number} = PropTypes;
       const propTypes = {
		threshold: number,
	};
	checkPropTypes(propTypes, $$props, "prop", "Observer");

This is giving error checkPropTypes is not a function

@ljharb
Copy link
Collaborator

ljharb commented Apr 4, 2022

import * as is almost never what you want; this is a CJS package so I’d suggest instead import PropTypes from ‘prop-types’, and then PropTypes.checkPropTypes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants