fails to detect components if used with recent react-intl
See original GitHub issueSo when using recent react-intl (^2.0.0-pr-2), you need to change classes in a way that breaks react-docgen:
export default class HomeButton extends React.Component {
becomes:
import {defineMessages, injectIntl, intlShape} from 'react-intl';
class GeocodingResults extends React.Component {
}
export default injectIntl(GeocodingResults);
Error with path "js/components/HomeButton.test.js": Error: No suitable component definition found.
Error: No suitable component definition found.
at parse (/Users/bartvandeneijnden/opengeo/git/sdk/node_modules/react-docgen/dist/parse.js:73:11)
at Object.defaultParse [as parse] (/Users/bartvandeneijnden/opengeo/git/sdk/node_modules/react-docgen/dist/main.js:65:33)
at /Users/bartvandeneijnden/opengeo/git/sdk/node_modules/react-docgen/bin/react-docgen.js:99:35
at /Users/bartvandeneijnden/opengeo/git/sdk/node_modules/react-docgen/node_modules/node-dir/lib/readfiles.js:110:34
at fs.js:334:14
at FSReqWrap.oncomplete (fs.js:95:15)
Is there a way around this? TIA.
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
got production error after upgrade React-Intl, Could not find ...
got production error after upgrade React-Intl, Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.
Read more >React Intl: Internationalize your React apps - LogRocket Blog
In this guide, we'll learn how to use the React Intl library to set up internationalization in a React project. We'll create a...
Read more >React Intl | Testing Library
If multiple elements have the same string/substring text, find-and-replace may be hard to use reliably. Mock the translation library, If your ...
Read more >Internationalization in React Apps using react-intl | by Mahesh
We have been using defaultMessage prop in <Formatted*/> components to provide fallback messages in case of failure in locale detection or ...
Read more >Components | Format.JS
All apps using React Intl must use the <IntlProvider> or <RawIntlProvider> component. This component is used to setup the i18n context for a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@tizmagik I’m using a small script, here is the code snippet:
@bartvde do you mind sharing where you landed with this? I’m having a similar issue and can’t seem to use the component found by
findAllComponentDefinitions()