Summary
When using Matter.js in a React Native / Expo project, builds fail with a Babel transpilation error,
because the @react-native/babel-plugin-codegen plugin treats 'Commands' as a reserved export name,
conflicting with Matter.js's Commands export in packages/node/dist/esm/endpoint/properties/Commands.js.
Error Message
ERROR SyntaxError: /path/to/matter/matter.js/packages/node/dist/esm/endpoint/properties/Commands.js: 'Commands' is a reserved export and may
only be used to export the result of codegenNativeCommands.
58 | }[name];
59 | }
> 60 | export {
| ^
61 | Commands
62 | };
Related code
https://github.com/facebook/react-native/blob/4064b89867cb7424fd02433c6d597e534bfc8cbc/packages/babel-plugin-codegen/index.js#L157