Currently our specs are done on our storybook app. With our current setup it will be diffulct to build storybook with a different react version then the one we have in the our package.json.
We've tried with some aliases, but it was not working since storybook code was expecting react 18.
const reactMajorVersion = process.env.REACT_MAJOR_VERSION;
const isOldReactVersion = ['16', '17'].includes(reactMajorVersion);
const reactModuleSufix = isOldReactVersion ? `-${reactMajorVersion}` : '';
webpackConfig.resolve.alias = {
...config.resolve.alias,
react: require.resolve(`react${reactModuleSufix}`), // react-16 or react-17
'react-dom': require.resolve(`react-dom${reactModuleSufix}`), // react-dom-16 or react-dom-17
};
We'll need to move our cypress tests away from storybook and build a small app where we have full control over the configuration and can easily swap react versions.
Currently our specs are done on our storybook app. With our current setup it will be diffulct to build storybook with a different react version then the one we have in the our package.json.
We've tried with some aliases, but it was not working since storybook code was expecting react 18.
We'll need to move our cypress tests away from storybook and build a small app where we have full control over the configuration and can easily swap react versions.