typescript-react-intl
Extracts string messages from TypeScript React components or ts files that use React Intl. You can use it in React Native
too.
Usage
If you have many files to processes,you can get contents use node-glob with fs module Custom component support since version
0.3.0
. checkout tests/index.js
npm i typescript-react-intl -D
var parse = default; // results is an array// contents is your tsx filevar results = ; // or if you want support custom componentsvar results = ;
React-intl
Only support <FormattedMessage/>
and defineMessages
We don't use <FormattedHtmlMessage/>
Examples
var fs = ;var glob = ;var parser = default; { var results = ; pattern = pattern || "src/**/*.@(tsx|ts)"; ;} // demo;