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 '@storybook/addon-ondevice-actions/register'; | |
import '@storybook/addon-ondevice-knobs/register'; |
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 '@storybook/addon-actions/register'; | |
import '@storybook/addon-knobs/register'; | |
import '@storybook/addon-links/register'; |
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
Show hidden characters
{ | |
"compilerOptions": { | |
"baseUrl": ".", | |
"paths": { | |
"*": ["src/*", "src/features/*"] | |
} | |
} | |
} |
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
module.exports = { | |
presets: ['@babel/preset-react', 'jest'], | |
plugins: [ | |
[ | |
'module-resolver', | |
{ | |
root: ['./src'], | |
extensions: ['.js', '.jsx', '.json', '.svg', '.png'], | |
// Note: you do not need to provide aliases for same-name paths immediately under /src/ | |
alias: { |
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
// Jest mock configuration for SVG imports | |
module.exports = { | |
moduleNameMapper: { | |
"\\.svg": "<rootDir>/__mocks__/svgMock.js" | |
} | |
}; |
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
/** | |
* SVG setup to mock react components transformed into images from SVGs | |
* Place this file in your project's root __mocks__ directory. | |
* https://github.com/kristerkari/react-native-svg-transformer#usage-with-jest | |
*/ | |
module.exports = 'SvgMock' | |
module.exports.ReactComponent = 'SvgMock' |
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 React from 'react'; | |
import { View } from 'react-native'; | |
import MyIcon from 'src/assets/my-svg-icon.svg'; | |
export default ExampleIcon = () => ( | |
<View> | |
<MyIcon width={48} height={48} fill="#000" /> | |
</View> | |
); |
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
/** | |
* Metro configuration for React Native with svg support | |
* https://github.com/facebook/react-native | |
* | |
* @format | |
*/ | |
const { getDefaultConfig } = require('metro-config'); | |
module.exports = (async () => { |
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 'react-native-gesture-handler'; | |
import React from 'react'; | |
import { Provider } from 'react-redux'; | |
import { Navigation as NavigationContainer } from '../navigation'; | |
import { configureStore } from 'redux/store'; | |
const store = configureStore(); | |
const App = () => ( |
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 { createStore, applyMiddleware } from 'redux'; | |
import thunk from 'redux-thunk'; | |
import { rootReducer } from 'redux/reducers'; | |
export const configureStore = () => { | |
const store = createStore(rootReducer, applyMiddleware(thunk)); | |
return store; | |
}; |