mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Switch 'number of lines' validation to DEV only (#44961)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/44961 Switch the "number of lines" warning, which ensures this value is not negative, to only fire in DEV. Changelog: [Internal] Reviewed By: yungsters Differential Revision: D58472148 fbshipit-source-id: e52849effe9a6dc3f25288a64deebd4fd7624e4e
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9435097b16
commit
b56646fa08
+5
-3
@@ -212,9 +212,11 @@ const Text: React.AbstractComponent<
|
||||
|
||||
let _numberOfLines = numberOfLines;
|
||||
if (_numberOfLines != null && !(_numberOfLines >= 0)) {
|
||||
console.error(
|
||||
`'numberOfLines' in <Text> must be a non-negative number, received: ${_numberOfLines}. The value will be set to 0.`,
|
||||
);
|
||||
if (__DEV__) {
|
||||
console.error(
|
||||
`'numberOfLines' in <Text> must be a non-negative number, received: ${_numberOfLines}. The value will be set to 0.`,
|
||||
);
|
||||
}
|
||||
_numberOfLines = 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user