Environment
OS: macOS High Sierra 10.13.5
Node: 8.11.2
Yarn: 1.7.0
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.4 Build version 9F1027a
Android Studio: 3.1 AI-173.4720617
Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.4 => 0.55.4
Description
When a parent View's marginBottom Props using a percentage value, the son View has marginBottom too, even though I didn't assign the Props.
Steps to Reproduce
I tried to use a percentage value for marginBottom, but it seems something incorrect.
To using the following code:
import React, {Component} from 'react';
import {View} from 'react-native';
export default class App extends Component {
render() {
return (
<View style={{
flex: 1,
marginBottom: '25%',
backgroundColor: "green",
}}>
<View style={{backgroundColor: 'yellow', flex: 1}}>
</View>
</View>
);
}
}
It comes out:

It seems like the 2nd View has a bottom margin too.
Then I Tried to add some children View:
render() {
return (
<View style={{
flex: 1,
marginBottom: '25%',
backgroundColor: "green",
}}>
<View style={{backgroundColor: 'yellow', flex: 1}}>
<View style={{backgroundColor: 'blue', flex: 1}}>
<View style={{backgroundColor: 'red', flex: 1}}>
<View style={{backgroundColor: 'orange', flex: 1}}>
</View>
</View>
</View>
</View>
</View>
);
}
It comes out:

The blue/red/orange Views have no bottom margin.
I tried to change the percentage value to number value:
render() {
return (
<View style={{
flex: 1,
marginBottom: 25,
backgroundColor: "green",
}}>
<View style={{backgroundColor: 'yellow', flex: 1}}>
<View style={{backgroundColor: 'blue', flex: 1}}>
<View style={{backgroundColor: 'red', flex: 1}}>
<View style={{backgroundColor: 'orange', flex: 1}}>
</View>
</View>
</View>
</View>
</View>
);
}
It comes out:

It works correct.
Expected Behavior
The 2nd View does not have a bottom margin.
Actual Behavior
The 2nd View do have a bottom margin.
react-native infoin your terminal and paste its contents under "Environment"share an app that reproduces the issue using https://snack.expo.io/
Environment
OS: macOS High Sierra 10.13.5
Node: 8.11.2
Yarn: 1.7.0
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.4 Build version 9F1027a
Android Studio: 3.1 AI-173.4720617
Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.4 => 0.55.4
Description
When a parent
View'smarginBottomProps using a percentage value, the sonViewhasmarginBottomtoo, even though I didn't assign the Props.Steps to Reproduce
I tried to use a percentage value for marginBottom, but it seems something incorrect.
To using the following code:
It comes out:

It seems like the 2nd
Viewhas a bottom margin too.Then I Tried to add some children
View:It comes out:

The blue/red/orange
Views have no bottom margin.I tried to change the percentage value to number value:
It comes out:

It works correct.
Expected Behavior
The 2nd
Viewdoes not have a bottom margin.Actual Behavior
The 2nd
Viewdo have a bottom margin.