With inlineRequires enabled, require(...) calls with default exports need to chain .default to the call. For example this would change the loadStories requires() from:
function loadStories() {
require("../src/components/ui/Button/Button.story");
require("../src/components/ui/Grid/Grid.story");
require("../src/components/ui/PopupModal/PopupModal.story");
}
to:
function loadStories() {
require("../src/components/ui/Button/Button.story").default;
require("../src/components/ui/Grid/Grid.story").default;
require("../src/components/ui/PopupModal/PopupModal.story").default;
}
React Native 0.59's Metro Bundler adds a new file:
metro.config.js
which includes the options:With
inlineRequires
enabled, require(...) calls with default exports need to chain.default
to the call. For example this would change the loadStories requires() from:to: