Created
April 9, 2020 07:17
-
-
Save hw0k/c7672789c110b73134043b4588cbdbbf to your computer and use it in GitHub Desktop.
RNSW 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { configure } from '@storybook/react'; | |
configure(require.context('../src', true, /\.stories\.js?$/), module); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta | |
name="viewport" | |
content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no" | |
/> | |
<link | |
rel="stylesheet" | |
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" | |
/> | |
<style> | |
html, | |
body { | |
padding: 0; | |
margin: 0; | |
} | |
#root { | |
position: absolute; | |
top: 0; | |
left: 0; | |
right: 0; | |
bottom: 0; | |
display: flex; | |
} | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
module.exports = ({ config }) => { | |
config.module.rules.push({ | |
test: /\.js?$/, | |
include: [ | |
path.resolve(__dirname, '../node_modules/react-native'), | |
], | |
use: [ | |
{ | |
loader: 'babel-loader', | |
options: { | |
presets: [ | |
'module:metro-react-native-babel-preset', | |
], | |
plugins: [ | |
['react-native-web', { commonjs: true }], | |
], | |
}, | |
}, | |
], | |
}); | |
config.resolve.alias['react-native$'] = 'react-native-web'; | |
config.resolve.extensions = ['.web.js', '.js', '.jsx']; | |
return config; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment