react-scanner icon indicating copy to clipboard operation
react-scanner copied to clipboard

Unknown node type: JSXSpreadChild

Open yakunins opened this issue 2 years ago • 0 comments

To support JSX spread child and to avoid such a error in scan.js:

Error: Unknown node type: JSXSpreadChild
    at getPropValue (C:\ServiceTitan\playground\DesignSystem\react-scanner\node_modules\react-scanner\src\scan.js:48:9)
    at getInstanceInfo (C:\ServiceTitan\playground\DesignSystem\react-scanner\node_modules\react-scanner\src\scan.js:82:11)
    at Object.exit (C:\ServiceTitan\playground\DesignSystem\react-scanner\node_modules\react-scanner\src\scan.js:221:22)

please replace https://github.com/moroshko/react-scanner/blob/8290a229b7818e06a053a8d4ea519eaa0c909a13/src/scan.js#L39 with

  if (node.type === "JSXExpressionContainer" || node.type === "JSXSpreadChild") {

yakunins avatar Aug 25 '23 01:08 yakunins