File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Libraries/Components/TextInput Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import TextInputState from './TextInputState';
2222import invariant from 'invariant' ;
2323import nullthrows from 'nullthrows' ;
2424import setAndForwardRef from '../../Utilities/setAndForwardRef' ;
25+ import warnOnce from '../../Utilities/warnOnce' ;
2526
2627import usePressability from '../../Pressability/usePressability' ;
2728
@@ -528,6 +529,7 @@ export type Props = $ReadOnly<{|
528529 defaultValue ?: ?Stringish ,
529530
530531 /**
532+ * @deprecated - use only readOnly instead
531533 * If `false`, text is not editable. The default value is `true`.
532534 */
533535 editable ?: ?boolean ,
@@ -1396,6 +1398,13 @@ const ExportedForwardRef: React.AbstractComponent<
13961398 React . ElementRef < HostComponent < mixed >> & ImperativeMethods ,
13971399 > ,
13981400) {
1401+ if ( __DEV__ && editable !== undefined ) {
1402+ warnOnce (
1403+ 'TextInput-editable-prop-deprecated' ,
1404+ 'The editable prop from TextInput has been deprecated and will be removed in a future release. Please use the readOnly prop instead' ,
1405+ ) ;
1406+ }
1407+
13991408 return (
14001409 < InternalTextInput
14011410 allowFontScaling = { allowFontScaling }
You can’t perform that action at this time.
0 commit comments