diff --git a/packages/react-native-web/src/exports/Text/index.js b/packages/react-native-web/src/exports/Text/index.js index 1c5792048..5af8cd46e 100644 --- a/packages/react-native-web/src/exports/Text/index.js +++ b/packages/react-native-web/src/exports/Text/index.js @@ -14,6 +14,7 @@ import { bool } from 'prop-types'; import { Component } from 'react'; import createElement from '../createElement'; import css from '../StyleSheet/css'; +import warning from 'fbjs/lib/warning'; import StyleSheet from '../StyleSheet'; import TextPropTypes from './TextPropTypes'; @@ -60,6 +61,10 @@ class Text extends Component<*> { const { isInAParentText } = this.context; + if (process.env.NODE_ENV !== 'production') { + warning(this.props.className == null, 'Using the "className" prop on is deprecated.'); + } + if (onPress) { otherProps.accessible = true; otherProps.onClick = this._createPressHandler(onPress); diff --git a/packages/react-native-web/src/exports/View/index.js b/packages/react-native-web/src/exports/View/index.js index 1a374b477..0c82a7802 100644 --- a/packages/react-native-web/src/exports/View/index.js +++ b/packages/react-native-web/src/exports/View/index.js @@ -13,6 +13,7 @@ import createElement from '../createElement'; import css from '../StyleSheet/css'; import filterSupportedProps from './filterSupportedProps'; import invariant from 'fbjs/lib/invariant'; +import warning from 'fbjs/lib/warning'; import StyleSheet from '../StyleSheet'; import ViewPropTypes, { type ViewProps } from './ViewPropTypes'; import React, { Component } from 'react'; @@ -42,6 +43,8 @@ class View extends Component { const supportedProps = filterSupportedProps(this.props); if (process.env.NODE_ENV !== 'production') { + warning(this.props.className == null, 'Using the "className" prop on is deprecated.'); + React.Children.toArray(this.props.children).forEach(item => { invariant( typeof item !== 'string',