![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@kadira/react-native-storybook
Advanced tools
A better way to develop React Native Components for your app
With React Native Storybook you can design and develop individual React Native components without running your application.
First, install the package from the npm registry and copy initial set of files
npm i -D @kadira/react-native-storybook
cp -r ./node_modules/@kadira/react-native-storybook/assets/template ./storybook
Edit index.ios.js file and the index.android.js file to set your root component name when calling AppRegistry.registerComponent
. And add the storybook npm script to the scripts section of your package.json file.
{
"start": "node node_modules/react-native/local-cli/cli.js start",
"storybook": "storybook start -p 9001"
}
Now you can write stories to preview and interact with your components. These story files can be placed almost anywhere within your project directory.
import React from 'react';
import { storiesOf } from '@kadira/react-native-storybook';
import ExampleComponent from '../../components/ExampleComponent';
storiesOf('ExampleComponent')
.add('First Story', () => (
<ExampleComponent foo="bar">First Story</ExampleComponent>
));
After writing stories, they must be imported into the storybook by requiring them inside the storybook/config.js file. Check the react-native-button repo for an example.
The fastest way to start storybook is to temporarily load it from your main index.ios.js
and index.android.js
files. When you want to run the storybook insert this line and comment out the rest of the file.
import './storybook';
Start the react-native debug server
npm run start
Start the storybook server
npm run storybook
And start your android/ios device or simulator. Stories will appear on http://localhost:9001 as soon as your device connects successfully.
There are a couple of drawbacks with the previous method.
React Native Storybook can be run without making changes to your index.__.js files but it'll take a few minutes to set it up.
In order to work with React Native Storybook, one or more devices should be connected. Stories will only show when devices are available. At the moment, remote javascript debugging should also be enabled for storybook to work #3.
react-native run-ios
emulator -list-avds
emulator -avd MY_AVD_NAME
adb reverse tcp:8081 tcp:8081
adb reverse tcp:9001 tcp:9001
react-native run-android
adb reverse tcp:8081 tcp:8081
adb reverse tcp:9001 tcp:9001
react-native run-android
v1.4.0
FAQs
A better way to develop React Native Components for your app
The npm package @kadira/react-native-storybook receives a total of 48 weekly downloads. As such, @kadira/react-native-storybook popularity was classified as not popular.
We found that @kadira/react-native-storybook demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.