moroshko / react-scanner

Extract React components and props usage from code.
MIT License
563 stars 40 forks source link

Lack of documentation on how to use 'components' config #69

Open coolcorexix opened 11 months ago

coolcorexix commented 11 months ago

Only when I check the source code did I guess right about how to use it,

async function scanFiles() {
  const results = await scanner.run({
    rootDir: '.',
    crawlFrom: 'app/react',
    includeSubComponents: true,
+    components: {
+      Switch: true,
+   },
    importedFrom: 'react-router-dom',
  });

it is also a little counter-intuitive. do you the author, think it should be:

...
components: ['Switch']
...