[web] Default active prop to true (#90)

* navigation expects the default of `active` value to be `true`
* fixed typo
This commit is contained in:
Evan Bacon
2019-04-25 01:53:14 -07:00
committed by Krzysztof Magiera
parent 033a6d3167
commit dd0d564cd3

View File

@@ -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 } });