Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@storybook/addon-react-native-web
Advanced tools
This addon configures @storybook/react
to display React Native (RN) projects using React Native for Web (RNW)
Assuming you've got an existing RN project, run the following from the project root:
npx sb@next init --type react
yarn add react-dom react-native-web babel-plugin-react-native-web @storybook/addon-react-native-web --dev
Then edit your .storybook/main.js
:
module.exports = {
addons: [/*existing addons,*/ '@storybook/addon-react-native-web'],
};
From here, you should be able to write stories incorporating your RN components according to the Storybook for React instructions.
Most packages should work without extra changes however in some cases extra steps are needed.
One common example is "reanimated" which requires some babel config and extra transpilation.
Many react-native packages are shipped untranspiled and this doesn't work for the web platform. If you receive errors like "proper loader not found" after adding a package try adding it to the modulesToTranspile
option for this addon.
You can do that like this:
module.exports = {
addons: [
/*existing addons,*/
{
name: '@storybook/addon-react-native-web',
options: {
modulesToTranspile: ['react-native-package-name'],
},
},
],
};
Replace react-native-package-name
with the name of a real package.
It's common to provide a babel plugin for certain packages in the react native eco system and you can pass a list of these to the addon.
module.exports = {
addons: [
/*existing addons,*/
{
name: '@storybook/addon-react-native-web',
options: {
babelPlugins: ['babel-plugin-name'],
},
},
],
};
Many libraries work without extra config, heres some examples of config required for some packages.
Note: react-native-vector-icons requires some extra steps due to fonts required and there will be a future addon with that config included.
Package | Required config |
react-native-svg | No extra config needed |
react-native-gesture-handler | No extra config needed |
react-native-reanimated |
Click to here to see the config
|
native-base |
Click to here to see the configDue to the vector icons dependency add the following
|
react-native-paper |
Click to here to see the configDue to the vector icons dependency add the following
|
<div>
and span
)
See the FAQ for more information.
FAQs
Configure React storybook for react-native-web
The npm package @storybook/addon-react-native-web receives a total of 64,829 weekly downloads. As such, @storybook/addon-react-native-web popularity was classified as popular.
We found that @storybook/addon-react-native-web demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.