We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In v0.68.0, padding is being applied when using margin style property
0.68.0
npx react-native info
System: OS: macOS 12.3.1 CPU: (8) arm64 Apple M1 Memory: 101.94 MB / 8.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 14.18.1 - ~/.nvm/versions/node/v14.18.1/bin/node Yarn: 1.22.17 - ~/.nvm/versions/node/v14.18.1/bin/yarn npm: 6.14.15 - ~/.nvm/versions/node/v14.18.1/bin/npm Watchman: 2021.11.01.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.2 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3 Android SDK: Not Found IDEs: Android Studio: 2020.3 AI-203.7717.56.2031.7784292 Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild Languages: Java: 11.0.14.1 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.68.0 => 0.68.0 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
import React from 'react'; import { View, Text, StyleSheet, StatusBar, Platform, TouchableOpacity, } from 'react-native'; export function Home() { return ( <View style={styles.container}> <StatusBar barStyle="light-content" /> <TouchableOpacity style={styles.button}> <Text style={styles.buttonText}>Add</Text> </TouchableOpacity> </View> ); } const styles = StyleSheet.create({ container: { flex: 1, paddingVertical: Platform.OS === 'ios' ? 70 : 30, paddingHorizontal: 30, backgroundColor: '#121015', }, button: { backgroundColor: '#e67e22', padding: 15, borderRadius: 7, alignItems: 'center', }, buttonText: { color: '#fff', fontSize: 17, fontWeight: 'bold', marginTop: 20, }, });
The text was updated successfully, but these errors were encountered:
Actually, it was my mistake, I applied the margin to the wrong element. The following code is working well.
import React from 'react'; import { View, Text, StyleSheet, StatusBar, Platform, TouchableOpacity, } from 'react-native'; export function Home() { return ( <View style={styles.container}> <StatusBar barStyle="light-content" /> <TouchableOpacity style={styles.button}> <Text style={styles.buttonText}>Add</Text> </TouchableOpacity> </View> ); } const styles = StyleSheet.create({ container: { flex: 1, paddingVertical: Platform.OS === 'ios' ? 70 : 30, paddingHorizontal: 30, backgroundColor: '#121015', }, button: { backgroundColor: '#e67e22', padding: 15, borderRadius: 7, alignItems: 'center', marginTop: 20, }, buttonText: { color: '#fff', fontSize: 17, fontWeight: 'bold', }, });
Sorry, something went wrong.
No branches or pull requests
Description
In v0.68.0, padding is being applied when using margin style property
Version
0.68.0
Output of
npx react-native info
System:
OS: macOS 12.3.1
CPU: (8) arm64 Apple M1
Memory: 101.94 MB / 8.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.18.1 - ~/.nvm/versions/node/v14.18.1/bin/node
Yarn: 1.22.17 - ~/.nvm/versions/node/v14.18.1/bin/yarn
npm: 6.14.15 - ~/.nvm/versions/node/v14.18.1/bin/npm
Watchman: 2021.11.01.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.2 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
Android SDK: Not Found
IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7784292
Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.14.1 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.68.0 => 0.68.0
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
Snack, code example, screenshot, or link to a repository
The text was updated successfully, but these errors were encountered: