Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

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
Contributor

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants