Skip to content

Instantly share code, notes, and snippets.

@quantumlicht
Created August 4, 2016 02:32
Show Gist options
  • Save quantumlicht/2a42e82dd822f9d5ce7e250d33116fdb to your computer and use it in GitHub Desktop.
Save quantumlicht/2a42e82dd822f9d5ce7e250d33116fdb to your computer and use it in GitHub Desktop.
Redux React-Native App
import React, { Component, PropTypes } from 'react'
import { connect } from 'react-redux'
import {
View
} from 'react-native'
import Svg,{
Circle,
Ellipse,
G,
LinearGradient,
RadialGradient,
Line,
Path,
Polygon,
Polyline,
Rect,
Symbol,
Text,
Use,
Defs,
Stop
} from 'react-native-svg'
class Remindr extends Component {
constructor(props) {
super(props)
}
render() {
return (
<View style={{flex: 1, margin: 100}}>
<Svg
height="100"
width="100"
>
<Circle
cx="50"
cy="50"
r="45"
stroke="blue"
strokeWidth="2.5"
fill="green"
/>
<Rect
x="15"
y="15"
width="70"
height="70"
stroke="red"
strokeWidth="2"
fill="yellow"
/>
</Svg>
</View>
)
}
}
function mapStateToProps(state) {
return {
}
}
export default connect(mapStateToProps)(Remindr)
import React, { Component } from 'react'
import { Provider } from 'react-redux'
import configureStore from '../configure-store'
import App from './app'
const store = configureStore()
export default class Root extends Component {
render() {
return (
<Provider store={store}>
<App />
</Provider>
)
}
}
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import { AppRegistry } from 'react-native';
import Root from './src/containers/root'
AppRegistry.registerComponent('Remindr', () => Root);
@quantumlicht
Copy link
Author

NOTE
the underscores in the filenames denote a "/" to indicate file hierarchy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment