Rmwc: TypeScript error of 'prop-types'

Created on 28 Nov 2018  路  3Comments  路  Source: jamesmfriedman/rmwc

Here is the error:

node_modules/@rmwc/base/index.d.ts:3:10 - error TS2305: Module '"/node_modules/@types/prop-types/index"' has no exported member 'default'.

3 export { default as PropTypes } from 'prop-types';
           ~~~~~~~

All 3 comments

I think change export { default as PropTypes } from 'prop-types'; to the below can fix this problem:

import * as PropTypes from 'prop-types';
export { PropTypes };

Thanks for reporting, will put out a patch today

Apparently export {* as PropTypes} from 'prop-types' is considered experimental syntax? Anyways, implemented your fix, appears to have resolved the issue. Thanks again for reporting, will be live on NPM shortly as 4.0.1.

Was this page helpful?
0 / 5 - 0 ratings