Storybook 8 is not supported by React Native integration
Storybook 8 is supported by Loki for the web platform, thanks to updates introduced in #507. However, the React Native integration has not yet been updated to align with the new APIs.
Identified Issues:
- storybook.raw() must be replaced with await __STORYBOOK_PREVIEW.extract().
- configureStorybookReactNative should be called after view.getStorybookUI.
- DevSettings.setHotLoadingEnabled(false); triggers a reload of the application, causing the "Loading bundle from..." toast message to be captured and displayed in screenshots, should be replaced with HMRClient.disable() and HMRClient.enable()
I made the necessary changes locally and successfully ran Loki.
Any update on this.
Any update on this.
@rishabh876 You can use patch-package with the contents of https://github.com/V3RON/loki/commit/207929d7cc75744d533d11ac62e43a669a0c55dd - should work just fine.
Any update on this.
@rishabh876 You can use patch-package with the contents of V3RON@207929d - should work just fine.
This works. Thanks!!!
Btw, for those that are on react-native 0.79.0 or newer, change the way HMRClient is imported. Instead of...
const HMRClient = require('react-native/Libraries/Utilities/HMRClient');
Do...
import HMRClient from 'react-native/Libraries/Utilities/HMRClient';
Otherwise, you will get errors. The reason is because react-native changed the way HMRClient is exported.
- https://github.com/facebook/react-native/blob/v0.78.3/packages/react-native/Libraries/Utilities/HMRClient.js
- https://github.com/facebook/react-native/blob/v0.79.0/packages/react-native/Libraries/Utilities/HMRClient.js