Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: temporary fix for #327 #351

Merged
merged 2 commits into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions app/react-native/scripts/__snapshots__/loader.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ import \\"@storybook/addon-ondevice-actions/register\\";
}


argsEnhancers.forEach(enhancer => addArgsEnhancer(enhancer))
// temporary fix for https://github.com/storybookjs/react-native/issues/327 whilst the issue is investigated
try {
argsEnhancers.forEach(enhancer => addArgsEnhancer(enhancer));
} catch{}


const getStories=() => {
return [require(\\"include-components/FakeStory.stories.tsx\\")];
Expand Down Expand Up @@ -60,7 +64,11 @@ import \\"@storybook/addon-ondevice-actions/register\\";
}


argsEnhancers.forEach(enhancer => addArgsEnhancer(enhancer))
// temporary fix for https://github.com/storybookjs/react-native/issues/327 whilst the issue is investigated
try {
argsEnhancers.forEach(enhancer => addArgsEnhancer(enhancer));
} catch{}


const getStories=() => {
return [require(\\"./FakeStory.stories.tsx\\")];
Expand All @@ -85,7 +93,11 @@ import \\"@storybook/addon-ondevice-actions/register\\";



argsEnhancers.forEach(enhancer => addArgsEnhancer(enhancer))
// temporary fix for https://github.com/storybookjs/react-native/issues/327 whilst the issue is investigated
try {
argsEnhancers.forEach(enhancer => addArgsEnhancer(enhancer));
} catch{}


const getStories=() => {
return [require(\\"./FakeStory.stories.tsx\\")];
Expand Down
10 changes: 6 additions & 4 deletions app/react-native/scripts/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ function writeRequires({ configPath, absolute = false }) {
cwd: path.resolve(cwd, configPath),
absolute,
// default to always ignore (exclude) anything in node_modules
ignore: normalizedExcludePaths !== undefined
? normalizedExcludePaths
: ['**/node_modules'],
ignore: normalizedExcludePaths !== undefined ? normalizedExcludePaths : ['**/node_modules'],
});
return [...acc, ...paths];
}, []);
Expand All @@ -84,7 +82,11 @@ function writeRequires({ configPath, absolute = false }) {
if (main.addons.includes('@storybook/addon-ondevice-actions')) {
enhancersImport =
'import { argsEnhancers } from "@storybook/addon-actions/dist/modern/preset/addArgs"';
enhancers = 'argsEnhancers.forEach(enhancer => addArgsEnhancer(enhancer))';
enhancers = `// temporary fix for https://github.com/storybookjs/react-native/issues/327 whilst the issue is investigated
try {
argsEnhancers.forEach(enhancer => addArgsEnhancer(enhancer));
} catch{}
`;
}

const fileContent = `
Expand Down