mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-05-20 04:21:11 +08:00
[web] Default active prop to true (#90)
* navigation expects the default of `active` value to be `true` * fixed typo
This commit is contained in:
committed by
Krzysztof Magiera
parent
033a6d3167
commit
dd0d564cd3
@@ -31,6 +31,10 @@ function isPropTruthy(prop) {
|
||||
}
|
||||
|
||||
export class Screen extends React.Component {
|
||||
static defaultProps = {
|
||||
active: true,
|
||||
};
|
||||
|
||||
listenerId = null;
|
||||
|
||||
constructor(props) {
|
||||
@@ -80,7 +84,7 @@ export class Screen extends React.Component {
|
||||
|
||||
_updateDisplay = isActive => {
|
||||
if (isActive === undefined) {
|
||||
isActive = isPropTruthy(this.props.isActive);
|
||||
isActive = isPropTruthy(this.props.active);
|
||||
}
|
||||
const display = isActive ? 'flex' : 'none';
|
||||
this.setNativeProps({ style: { display } });
|
||||
|
||||
Reference in New Issue
Block a user