mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-01 01:59:10 +00:00
Support style inspection in production
This commit is contained in:
@@ -1,11 +1,9 @@
|
|||||||
import { canUseDOM } from 'fbjs/lib/ExecutionEnvironment';
|
import { canUseDOM } from 'fbjs/lib/ExecutionEnvironment';
|
||||||
import StyleSheet from './StyleSheet';
|
import StyleSheet from './StyleSheet';
|
||||||
|
|
||||||
// allow component styles to be editable in React Dev Tools
|
// allow original component styles to be inspected in React Dev Tools
|
||||||
if (process.env.NODE_ENV !== 'production') {
|
if (canUseDOM && window.__REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||||
if (canUseDOM && window.__REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
window.__REACT_DEVTOOLS_GLOBAL_HOOK__.resolveRNStyle = StyleSheet.flatten;
|
||||||
window.__REACT_DEVTOOLS_GLOBAL_HOOK__.resolveRNStyle = StyleSheet.flatten;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default StyleSheet;
|
export default StyleSheet;
|
||||||
|
|||||||
Reference in New Issue
Block a user