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 MyComponent from '../MyComponent' | |
export default class MyContainer extends Component { | |
constructor (props) { | |
super(props) | |
this.state = { | |
// ... | |
} | |
} |
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 Button from '../Button' | |
import style from './style' | |
const MyComponent = ({ headerText, buttons }) => ( | |
<View style={style.container}> | |
<View style={style.headerWrapper}> | |
<Text style={style.headerText}> | |
{headerText} | |
</Text> | |
</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
export default class MyContainer extends Component { | |
contructor (props) { | |
super(props) | |
this.classPropertyA = 'something' | |
this.classPropertyB = 123 | |
this.state = { | |
stateItemA: undefined, | |
stateItemB: 'default string' |
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
export default class MyContainer extends Component { | |
classPropertyA = 'something' | |
classPropertyB = 123 | |
state = { | |
stateItemA: undefined, | |
stateItemB: 'default string' | |
} | |
someMethod = () => { |
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
export default MyContainer extends Component { | |
static propTypes = { | |
someProp: PropTypes.string.isRequired, | |
anotherProp: PropTypes.number | |
} | |
static defaultProps = { | |
anotherProp: 123 | |
} |
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 mapStateToProps = state => { | |
const { someStore: { someProperty } } = state | |
const somePropertyPlusOne = someProperty + 1 | |
return { | |
somePropertyPlusOne | |
} | |
} | |
class MyContainer extends Component { | |
// ... |
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
@connect(state => { | |
const { someStore: { someProperty } } = state | |
const somePropertyPlusOne = someProperty + 1 | |
return { | |
somePropertyPlusOne | |
} | |
}) | |
export default class MyContainer extends Component { | |
// ... |
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 mapStateToProps = state => { | |
const { someStore: { someProperty } } = state | |
return { | |
someProperty | |
} | |
} | |
class MyContainer extends Component { | |
// ... | |
} |
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
@reduxForm({ form: 'someForm' }) | |
@connect(state => { | |
const { someStore: { someProperty } } = state | |
return { | |
someProperty | |
} | |
}) | |
export default class MyContainer extends Component { | |
// ... | |
} |
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
class MyContainer extends Component { | |
state = { | |
itemA: 'something', | |
itemB: 'another thing' | |
} | |
_onPress = () => { | |
// ... | |
} | |
OlderNewer