facebook / metro

🚇 The JavaScript bundler for React Native
https://metrobundler.dev
MIT License
5.25k stars 626 forks source link

error: bundling failed: SyntaxError: Unexpected reserved type (any, string, func, Boolean ) #1153

Closed sundardsTechMind closed 10 months ago

sundardsTechMind commented 11 months ago
error2

File Name : AuthSignUpContainer.js:

I'm using This Package

import PropTypes from 'prop-types';

error: bundling failed: SyntaxError: Unexpected reserved type any. (14) error: bundling failed: SyntaxError: Unexpected reserved type func. (16)

13 | type Props = {

14 | AuthSignUpReducer: PropTypes.any, | ^ 15 | authSignUpReset: PropTypes.func, 16 | authSignUpDismissMessages: PropTypes.func, 17 | };

can anyone help me ASAP.

Thanks in advance.

robhogan commented 10 months ago

Hi @sundardsTechMind - propTypes are for runtime checks, they're not Flow/TypeScript types (you can't use them within type Foo = { ... }).

See https://legacy.reactjs.org/docs/typechecking-with-proptypes.html for how to use them, and try StackOverflow if you have further questions.

Closing as this isn't a Metro issue.