Problem
In React Native project in my company I came across such code, aggregating exports from multiple modules:
export Icon from "./Icon";
export Input from "./Input";
export Pills from "./Pills";
My editor highlights this as invalid syntax. I checked MDN docs on export and indeed they don't list such a syntax for aggregation. From what they list it seems the proper one would be:
export { default as Icon } from "./Icon";
export { default as Input } from "./Input";
export { default as Pills } from "./Pills";
But then the first code works in React Native project I'm in.
Question
Is this a valid syntax in JavaScript, or is it only available by some third party package we're using in the project?
Icon, while what the code in the post is exporting on aredefaultexports, not named ones.