From 01974854fcd81f3297c10b77eb2a31db7a1b8b6d Mon Sep 17 00:00:00 2001 From: M-i-k-e-l Date: Wed, 31 Dec 2025 11:13:08 +0200 Subject: [PATCH 1/4] Remove DemoScreen (unused) --- demo/src/screens/DemoScreen.js | 96 ---------------------------------- 1 file changed, 96 deletions(-) delete mode 100644 demo/src/screens/DemoScreen.js diff --git a/demo/src/screens/DemoScreen.js b/demo/src/screens/DemoScreen.js deleted file mode 100644 index 0b501336d2..0000000000 --- a/demo/src/screens/DemoScreen.js +++ /dev/null @@ -1,96 +0,0 @@ -import React, {Component} from 'react'; -import PropTypes from 'prop-types'; -import _ from 'lodash'; -import {ScrollView, Switch} from 'react-native'; -import {View, TextField, Text, Badge, Colors} from 'react-native-ui-lib';//eslint-disable-line - -export default class DemoScreen extends Component { - - constructor(props) { - super(props); - - this.state = { - backgroundColor: Colors.red50, - label: '12', - }; - - this.updatePropValue = this.updatePropValue.bind(this); - } - - componentDidMount() { - this.getComponentProps(); - } - - getComponentProps() { - const DemoComponent = this.getComponent(); - return DemoComponent.propTypes; - } - - shouldRenderProp(propId) { - let shouldRender = true; - shouldRender = shouldRender && propId !== 'testID'; - if (this.propsToRender) { - shouldRender = shouldRender && _.includes(this.propsToRender, propId); - } - return shouldRender; - } - - updatePropValue(value, propId, prop) { - let validValue = value; - - if (prop === PropTypes.number) { - validValue = isNaN(value) ? undefined : Number(value); - } - - this.setState({ - [propId]: validValue, - }); - } - - - renderProp(prop, propId) { - if (!this.shouldRenderProp(propId)) return; - - if (PropTypes.bool === prop) { - return ( - - - {propId} - - this.updatePropValue(value, propId, prop)} - /> - - ); - } - - // if (_.includes([PropTypes.string, PropTypes.number], prop)) { - return ( - - this.updatePropValue(text, propId, prop)} - autoCapitalize='none' - /> - - ); - // } - } - - renderComponentSettings() { - const props = this.getComponentProps(); - return ( - - - {_.map(props, (prop, propId) => { - return this.renderProp(prop, propId); - })} - - - ); - } -} From de980b7af9023b40f035f546cda01ecc756dfa25 Mon Sep 17 00:00:00 2001 From: M-i-k-e-l Date: Wed, 31 Dec 2025 13:34:08 +0200 Subject: [PATCH 2/4] Remove prop-types --- demo/src/screens/MainScreen.js | 8 -- .../ConversationListScreen.js | 8 -- .../foundationScreens/TypographyScreen.js | 5 - .../realExamples/ListActions/ActionsList.js | 6 - lib/package.json | 3 +- packages/react-native-ui-lib/package.json | 2 - .../src/commons/__tests__/modifiers.spec.js | 5 - .../src/commons/baseComponent.tsx | 7 - .../KeyboardAwareBase.js | 7 - .../KeyboardAwareFlatList.js | 6 - .../KeyboardAwareScrollView.js | 6 - .../src/components/animatedScanner/index.js | 37 ----- .../src/components/carousel/types.ts | 8 +- .../src/components/maskedInput/old.js | 13 -- .../components/picker/PickerDialog.android.js | 15 -- .../src/components/picker/PickerDialog.js | 7 - .../src/components/textArea/index.js | 6 - .../src/components/textFieldOld/index.tsx | 132 ------------------ .../src/components/toast/index.js | 69 --------- .../src/components/wizard/types.ts | 2 +- .../src/components/wizard/wizard.api.json | 2 +- yarn.lock | 24 +--- 22 files changed, 10 insertions(+), 368 deletions(-) diff --git a/demo/src/screens/MainScreen.js b/demo/src/screens/MainScreen.js index e739c1db10..3f49f23529 100644 --- a/demo/src/screens/MainScreen.js +++ b/demo/src/screens/MainScreen.js @@ -1,8 +1,6 @@ import _ from 'lodash'; import React, {Component} from 'react'; -import PropTypes from 'prop-types'; import {StyleSheet, FlatList, SectionList, ScrollView} from 'react-native'; -import {ViewPropTypes} from 'deprecated-react-native-prop-types'; import {Navigation} from 'react-native-navigation'; import { Assets, @@ -27,12 +25,6 @@ const chevronIcon = require('../assets/icons/chevronRight.png'); const FADER_SIZE = 50; class MainScreen extends Component { - static propTypes = { - containerStyle: ViewPropTypes.style, - renderItem: PropTypes.func, - pageStyle: ViewPropTypes.style - }; - settingsScreenName = 'unicorn.Settings'; static options() { diff --git a/demo/src/screens/componentScreens/ConversationListScreen.js b/demo/src/screens/componentScreens/ConversationListScreen.js index 02ccf9be33..1c25659a16 100644 --- a/demo/src/screens/componentScreens/ConversationListScreen.js +++ b/demo/src/screens/componentScreens/ConversationListScreen.js @@ -1,5 +1,4 @@ import _ from 'lodash'; -import PropTypes from 'prop-types'; import React, {Component, PureComponent} from 'react'; import {StyleSheet, Alert, FlatList} from 'react-native'; import {Colors, ListItem, Text, Avatar, AvatarHelper, Drawer, Button} from 'react-native-ui-lib'; //eslint-disable-line @@ -121,13 +120,6 @@ class ConversationListScreen extends Component { } class ContactItem extends PureComponent { - static propTypes = { - item: PropTypes.object, - index: PropTypes.number, - addRef: PropTypes.func, - onSwipeableWillOpen: PropTypes.func - }; - render() { const {item, index, addRef, onSwipeableWillOpen} = this.props; diff --git a/demo/src/screens/foundationScreens/TypographyScreen.js b/demo/src/screens/foundationScreens/TypographyScreen.js index bda6316dbd..67adfa7c4a 100644 --- a/demo/src/screens/foundationScreens/TypographyScreen.js +++ b/demo/src/screens/foundationScreens/TypographyScreen.js @@ -1,5 +1,4 @@ import _ from 'lodash'; -import PropTypes from 'prop-types'; import React, {Component} from 'react'; import {ScrollView} from 'react-native'; import {TabController, Colors, Typography, View, Text} from 'react-native-ui-lib'; @@ -7,10 +6,6 @@ import {TabController, Colors, Typography, View, Text} from 'react-native-ui-lib const WEIGHTS = ['Thin', 'Light', 'Default', 'Regular', 'Medium', 'Bold', 'Heavy', 'Black']; export default class TypographyScreen extends Component { - static propTypes = { - color: PropTypes.string - }; - static defaultProps = { color: Colors.grey10 }; diff --git a/demo/src/screens/realExamples/ListActions/ActionsList.js b/demo/src/screens/realExamples/ListActions/ActionsList.js index 720ce21a36..0a9737cb62 100644 --- a/demo/src/screens/realExamples/ListActions/ActionsList.js +++ b/demo/src/screens/realExamples/ListActions/ActionsList.js @@ -1,4 +1,3 @@ -import PropTypes from 'prop-types'; import React, {Component} from 'react'; import {Animated, LayoutAnimation, PanResponder, I18nManager} from 'react-native'; import {Constants, Assets, Colors, View, TouchableOpacity, Button, Text} from 'react-native-ui-lib'; //eslint-disable-line @@ -17,11 +16,6 @@ const DIRECTIONS = { export default class ActionsList extends Component { static displayName = 'ActionsList'; - - static propTypes = { - item: PropTypes.object, - index: PropTypes.number - } constructor(props) { super(props); diff --git a/lib/package.json b/lib/package.json index c16d58f453..0c61b6a28d 100644 --- a/lib/package.json +++ b/lib/package.json @@ -10,8 +10,7 @@ "author": "Ethan Sharabi ", "license": "MIT", "dependencies": { - "lodash": "^4.17.21", - "prop-types": "^15.5.10" + "lodash": "^4.17.21" }, "devDependencies": { "shell-utils": "^1.0.10" diff --git a/packages/react-native-ui-lib/package.json b/packages/react-native-ui-lib/package.json index 15423f2aed..0a3920c2ff 100644 --- a/packages/react-native-ui-lib/package.json +++ b/packages/react-native-ui-lib/package.json @@ -32,11 +32,9 @@ "color": "^3.1.0", "commons-validator-js": "^1.0.237", "date-fns": "^2.29.3", - "deprecated-react-native-prop-types": "^2.3.0", "hoist-non-react-statics": "^3.0.0", "lodash": "^4.17.21", "memoize-one": "^5.0.5", - "prop-types": "^15.5.10", "react-freeze": "^1.0.0", "react-native-redash": "^12.0.3", "semver": "^5.5.0", diff --git a/packages/react-native-ui-lib/src/commons/__tests__/modifiers.spec.js b/packages/react-native-ui-lib/src/commons/__tests__/modifiers.spec.js index e527c514f2..789bf2d07d 100644 --- a/packages/react-native-ui-lib/src/commons/__tests__/modifiers.spec.js +++ b/packages/react-native-ui-lib/src/commons/__tests__/modifiers.spec.js @@ -1,14 +1,9 @@ -import PropTypes from 'prop-types'; import {ThemeManager, Colors, Typography, BorderRadiuses, Spacings} from '../../style'; import * as uut from '../modifiers'; describe('Modifiers', () => { const SampleComponent = () => {}; SampleComponent.displayName = 'SampleComponent'; - SampleComponent.propTypes = { - prop1: PropTypes.string, - prop2: PropTypes.number - }; describe('extractColorValue', () => { it('should return color value according to modifier', () => { diff --git a/packages/react-native-ui-lib/src/commons/baseComponent.tsx b/packages/react-native-ui-lib/src/commons/baseComponent.tsx index 180129297c..2ab4affa83 100644 --- a/packages/react-native-ui-lib/src/commons/baseComponent.tsx +++ b/packages/react-native-ui-lib/src/commons/baseComponent.tsx @@ -1,5 +1,4 @@ import React, {ComponentType} from 'react'; -// import PropTypes from 'prop-types'; import {StyleSheet} from 'react-native'; import _ from 'lodash'; import {Colors} from '../style'; @@ -8,12 +7,6 @@ import * as Modifiers from './modifiers'; export default function baseComponent(usePure: boolean): ComponentType { const parent = usePure ? React.PureComponent : React.Component; class BaseComponent extends parent { - // static propTypes = { - // ..._.mapValues(Typography, () => PropTypes.bool), - // ..._.mapValues(Colors, () => PropTypes.bool), - // useNativeDriver: PropTypes.bool, - // }; - styles: any; view: any; diff --git a/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareBase.js b/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareBase.js index 0a456af5d1..5ecdb2e7d4 100644 --- a/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareBase.js +++ b/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareBase.js @@ -1,6 +1,5 @@ import _ from 'lodash'; import {Component} from 'react'; -import PropTypes from 'prop-types'; import ReactNative, {DeviceEventEmitter, Keyboard} from 'react-native'; export default class KeyboardAwareBase extends Component { @@ -22,12 +21,6 @@ export default class KeyboardAwareBase extends Component { this._addKeyboardEventListeners(); } - static propTypes = { - startScrolledToBottom: PropTypes.bool, - scrollToBottomOnKBShow: PropTypes.bool, - scrollToInputAdditionalOffset: PropTypes.number - }; - static defaultProps = { startScrolledToBottom: false, scrollToBottomOnKBShow: false, diff --git a/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareFlatList.js b/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareFlatList.js index 55b4bb6ed3..ca59e294c3 100644 --- a/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareFlatList.js +++ b/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareFlatList.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import {FlatList} from 'react-native'; import KeyboardAwareBase from './KeyboardAwareBase'; @@ -10,11 +9,6 @@ import KeyboardAwareBase from './KeyboardAwareBase'; export default class KeyboardAwareFlatList extends KeyboardAwareBase { static displayName = 'KeyboardAwareFlatList'; - static PropTypes = { - getTextInputRefs: PropTypes.func, - onScroll: PropTypes.func - }; - static defaultProps = { ...KeyboardAwareBase.defaultProps, getTextInputRefs: () => { diff --git a/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js b/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js index 5bfa0518b6..9dd8dbba1b 100644 --- a/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +++ b/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import {ScrollView} from 'react-native'; import KeyboardAwareBase from './KeyboardAwareBase'; @@ -10,11 +9,6 @@ import KeyboardAwareBase from './KeyboardAwareBase'; export default class KeyboardAwareScrollView extends KeyboardAwareBase { static displayName = 'KeyboardAwareScrollView'; - static PropTypes = { - getTextInputRefs: PropTypes.func, - onScroll: PropTypes.func - }; - static defaultProps = { ...KeyboardAwareBase.defaultProps, getTextInputRefs: () => { diff --git a/packages/react-native-ui-lib/src/components/animatedScanner/index.js b/packages/react-native-ui-lib/src/components/animatedScanner/index.js index 3fc6291f7c..bf480c76ae 100644 --- a/packages/react-native-ui-lib/src/components/animatedScanner/index.js +++ b/packages/react-native-ui-lib/src/components/animatedScanner/index.js @@ -1,8 +1,6 @@ import _ from 'lodash'; -import PropTypes from 'prop-types'; import React from 'react'; import {StyleSheet, Animated} from 'react-native'; -import {ViewPropTypes} from 'deprecated-react-native-prop-types'; import {Colors} from '../../style'; import {BaseComponent} from '../../commons'; import View from '../../components/view'; @@ -16,41 +14,6 @@ import View from '../../components/view'; */ export default class AnimatedScanner extends BaseComponent { static displayName = 'AnimatedScanner'; - static propTypes = { - /** - * animated value between 0 and 100 - */ - // progress: PropTypes.object, - progress: PropTypes.number, - /** - * Duration of current break (can be change between breaks) - */ - duration: PropTypes.number, - /** - * scanner opacity - */ - opacity: PropTypes.number, - /** - * scanner background color - */ - backgroundColor: PropTypes.string, - /** - * breakpoint callback - ({progress, isDone}) => {} - */ - onBreakpoint: PropTypes.func, - /** - * should hide the scanner line - */ - hideScannerLine: PropTypes.bool, - /** - * the container style - */ - containerStyle: ViewPropTypes.style, - /** - * Used as a testing identifier - */ - testID: PropTypes.string - }; static defaultProps = { progress: 0, diff --git a/packages/react-native-ui-lib/src/components/carousel/types.ts b/packages/react-native-ui-lib/src/components/carousel/types.ts index d813ca86a3..221a502d20 100644 --- a/packages/react-native-ui-lib/src/components/carousel/types.ts +++ b/packages/react-native-ui-lib/src/components/carousel/types.ts @@ -1,6 +1,4 @@ import {ScrollViewProps, StyleProp, ViewStyle, NativeSyntheticEvent, NativeScrollEvent, Animated} from 'react-native'; -// @ts-expect-error No typings available for 'deprecated-react-native-prop-types' -import {PointPropType} from 'deprecated-react-native-prop-types'; import {PageControlProps} from '../pageControl'; export enum PageControlPosition { @@ -8,6 +6,11 @@ export enum PageControlPosition { UNDER = 'under' } +export type PointPropType = { + x: number; + y: number; +}; + export interface CarouselProps extends ScrollViewProps { /** * the first page to start with @@ -96,7 +99,6 @@ export interface CarouselProps extends ScrollViewProps { * Carousel scroll offset (pass new Animated.ValueXY()) */ animatedScrollOffset?: Animated.ValueXY; - } export interface CarouselState { diff --git a/packages/react-native-ui-lib/src/components/maskedInput/old.js b/packages/react-native-ui-lib/src/components/maskedInput/old.js index 0019549508..c14939dd8b 100644 --- a/packages/react-native-ui-lib/src/components/maskedInput/old.js +++ b/packages/react-native-ui-lib/src/components/maskedInput/old.js @@ -1,8 +1,6 @@ import _ from 'lodash'; -import PropTypes from 'prop-types'; import React from 'react'; import {StyleSheet, Keyboard} from 'react-native'; -import {ViewPropTypes} from 'deprecated-react-native-prop-types'; import BaseInput from '../baseInput'; import TextField from '../textFieldOld'; import View from '../view'; @@ -16,17 +14,6 @@ import TouchableOpacity from '../touchableOpacity'; */ export default class MaskedInput extends BaseInput { static displayName = 'MaskedInput'; - static propTypes = { - ...TextField.propTypes, - /** - * callback for rendering the custom input out of the value returns from the actual input - */ - renderMaskedText: PropTypes.elementType.isRequired, - /** - * container style for the masked input container - */ - containerStyle: ViewPropTypes.style - }; componentDidMount() { this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', () => { diff --git a/packages/react-native-ui-lib/src/components/picker/PickerDialog.android.js b/packages/react-native-ui-lib/src/components/picker/PickerDialog.android.js index 0ea1f25b45..ffe959d445 100644 --- a/packages/react-native-ui-lib/src/components/picker/PickerDialog.android.js +++ b/packages/react-native-ui-lib/src/components/picker/PickerDialog.android.js @@ -1,7 +1,5 @@ import React, {Component} from 'react'; import {StyleSheet} from 'react-native'; -import {TextPropTypes} from 'deprecated-react-native-prop-types'; -import PropTypes from 'prop-types'; import _ from 'lodash'; import Dialog from '../dialog'; @@ -11,19 +9,6 @@ import {Colors, BorderRadiuses} from '../../style'; class PickerDialog extends Component { static displayName = 'PickerDialog'; - static propTypes = { - onDone: PropTypes.func, - onCancel: PropTypes.func, - children: PropTypes.array, - /** - * select label style - */ - selectLabelStyle: TextPropTypes.style, - /** - * cancel label style - */ - cancelLabelStyle: TextPropTypes.style - }; state = {}; diff --git a/packages/react-native-ui-lib/src/components/picker/PickerDialog.js b/packages/react-native-ui-lib/src/components/picker/PickerDialog.js index 9e1a311d12..3de99c6ed4 100644 --- a/packages/react-native-ui-lib/src/components/picker/PickerDialog.js +++ b/packages/react-native-ui-lib/src/components/picker/PickerDialog.js @@ -1,6 +1,5 @@ import React, {Component} from 'react'; import {StyleSheet} from 'react-native'; -import PropTypes from 'prop-types'; import _ from 'lodash'; import Dialog from '../dialog'; @@ -10,12 +9,6 @@ import {Colors} from '../../style'; class PickerDialog extends Component { static displayName = 'PickerDialog'; - static propTypes = { - onDone: PropTypes.func, - onCancel: PropTypes.func, - topBarProps: PropTypes.object, - children: PropTypes.array - }; state = {}; diff --git a/packages/react-native-ui-lib/src/components/textArea/index.js b/packages/react-native-ui-lib/src/components/textArea/index.js index 410efc248e..5d602d2943 100644 --- a/packages/react-native-ui-lib/src/components/textArea/index.js +++ b/packages/react-native-ui-lib/src/components/textArea/index.js @@ -1,6 +1,5 @@ import React from 'react'; import {View, TextInput as RNTextInput, StyleSheet} from 'react-native'; -import {TextInputPropTypes} from 'deprecated-react-native-prop-types'; import BaseInput from '../baseInput'; import {Colors} from '../../style'; @@ -15,11 +14,6 @@ import {Colors} from '../../style'; export default class TextArea extends BaseInput { static displayName = 'TextArea'; - static propTypes = { - ...TextInputPropTypes, - ...BaseInput.propTypes - }; - generateStyles() { this.styles = createStyles(this.props); } diff --git a/packages/react-native-ui-lib/src/components/textFieldOld/index.tsx b/packages/react-native-ui-lib/src/components/textFieldOld/index.tsx index 3c94df0b10..dda34ea5da 100644 --- a/packages/react-native-ui-lib/src/components/textFieldOld/index.tsx +++ b/packages/react-native-ui-lib/src/components/textFieldOld/index.tsx @@ -6,10 +6,8 @@ // TODO: add trailing/leading icon props // TODO: support margin modifiers import _ from 'lodash'; -import PropTypes from 'prop-types'; import React from 'react'; import {StyleSheet, Animated, TextInput as RNTextInput} from 'react-native'; -import {TextInputPropTypes, ImagePropTypes} from 'deprecated-react-native-prop-types'; import memoize from 'memoize-one'; import {Constants} from '../../commons/new'; import {Colors, Typography, Spacings} from '../../style'; @@ -57,136 +55,6 @@ const FLOATING_PLACEHOLDER_SCALE = 0.875; export default class TextField extends BaseInput { static displayName = 'TextFieldOld'; - static propTypes = { - ...TextInputPropTypes, - ...BaseInput.propTypes, - /** - * should placeholder have floating behavior - */ - floatingPlaceholder: PropTypes.bool, - /** - * floating placeholder color as a string or object of states, ex. {default: 'black', error: 'red', focus: 'blue', disabled: 'grey'} - */ - floatingPlaceholderColor: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), - /** - * Custom style for floating placeholder - */ - floatingPlaceholderStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]), - /** - * This text will appear as a placeholder when the textInput becomes focused, only when passing floatingPlaceholder - * as well (NOT for expandable textInputs) - */ - helperText: PropTypes.string, - /** - * hide text input underline, by default false - */ - hideUnderline: PropTypes.bool, - /** - * underline color as a string or object of states, ex. {default: 'black', error: 'red', focus: 'blue', disabled: 'grey'} - */ - underlineColor: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), - /** - * the color of all text when the input is disabled (if undefined will not apply color) - */ - disabledColor: PropTypes.string, - /** - * should text input be align to center - */ - centered: PropTypes.bool, - /** - * input error message, should be empty if no error exists - */ - error: PropTypes.string, - /** - * should the input component support error messages - */ - enableErrors: PropTypes.bool, - /** - * input error message's text color - */ - errorColor: PropTypes.string, - /** - * should the input expand to another text area modal - */ - expandable: PropTypes.bool, - /** - * Render custom expandable input (requires expandable to be true) - */ - renderExpandableInput: PropTypes.elementType, - /** - * allow custom rendering of expandable content when clicking on the input (useful for pickers) - * accept props and state as params, ex. (props, state) => {...} - * use toggleExpandableModal(false) method to toggle off the expandable content - */ - renderExpandable: PropTypes.elementType, - /** - * Callback for the modal toggle. Pass with renderExpandable to control the modal toggle - */ - onToggleExpandableModal: PropTypes.func, - /** - * The picker modal top bar props - */ - topBarProps: PropTypes.shape(Modal.TopBar.propTypes), - /** - * transform function executed on value and return transformed value - */ - transformer: PropTypes.func, - /** - * Pass to render a prefix text as part of the input (doesn't work with floatingPlaceholder) - */ - prefix: PropTypes.string, - /** - * The prefix style - */ - prefixStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]), - /** - * Fixed title that will displayed above the input (note: floatingPlaceholder MUST be 'false') - */ - title: PropTypes.string, - /** - * The title's color as a string or object of states, ex. {default: 'black', error: 'red', focus: 'blue', disabled: 'grey'} - */ - titleColor: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), - /** - * Additional styles for the title (not including 'color') - */ - titleStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]), - /** - * should the input display a character counter (only when passing 'maxLength') - */ - showCharacterCounter: PropTypes.bool, - /** - * should float the placeholder when focused (instead of when typing) - */ - floatOnFocus: PropTypes.bool, - /** - * should the errors be displayed at the top - */ - useTopErrors: PropTypes.bool, - /** - * Icon asset source for showing on the right side, appropriate for dropdown icon and such - */ - rightIconSource: PropTypes.oneOfType([PropTypes.object, PropTypes.number]), - /** - * Pass to style the right icon source - */ - rightIconStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number]), - /** - * Props for the right button {iconSource, onPress, style} - */ - rightButtonProps: PropTypes.shape({ - iconSource: ImagePropTypes.source, - iconColor: PropTypes.string, - onPress: PropTypes.func, - style: PropTypes.oneOfType([PropTypes.object, PropTypes.number]), - accessibilityLabel: PropTypes.string - }), - /** - * Pass to render a leading icon to the TextInput value. Accepts Image props (doesn't work with floatingPlaceholder) - */ - leadingIcon: PropTypes.shape(ImagePropTypes) - }; - static defaultProps = { enableErrors: true, validateOnBlur: true diff --git a/packages/react-native-ui-lib/src/components/toast/index.js b/packages/react-native-ui-lib/src/components/toast/index.js index f1408ee0b2..63e77af3a0 100644 --- a/packages/react-native-ui-lib/src/components/toast/index.js +++ b/packages/react-native-ui-lib/src/components/toast/index.js @@ -1,5 +1,4 @@ import _ from 'lodash'; -import PropTypes from 'prop-types'; import React from 'react'; import {AccessibilityInfo, findNodeHandle, StyleSheet, Animated, Easing, ActivityIndicator} from 'react-native'; import {PureBaseComponent} from '../../commons'; @@ -21,74 +20,6 @@ const COLOR = Colors.white; export default class Toast extends PureBaseComponent { static displayName = 'Toast'; - static propTypes = { - /** - * Whether to show or hide the toast - */ - visible: PropTypes.bool, - /** - * The position of the toast. 'top' or 'bottom'. - */ - position: PropTypes.oneOf(['top', 'bottom']), - /** - * custom zIndex for toast - */ - zIndex: PropTypes.number, - /** - * The background color of the toast - */ - backgroundColor: PropTypes.string, - /** - * the toast content color (message, actions labels) - */ - color: PropTypes.string, - /** - * the toast message - */ - message: PropTypes.string, - /** - * should message be centered in the toast - */ - centerMessage: PropTypes.bool, - /** - * a left icon - */ - icon: PropTypes.oneOfType([PropTypes.object, PropTypes.number]), - /** - * a single action for the user - */ - action: PropTypes.shape(Button.propTypes), - /** - * should show a loader (showDismiss must be false) - */ - showLoader: PropTypes.bool, - /** - * callback for dismiss action - */ - onDismiss: PropTypes.func, - /** - * number of milliseconds to automatically invoke the onDismiss callback - */ - autoDismiss: PropTypes.number, - /** - * show dismiss action (right 'X' button) - */ - showDismiss: PropTypes.bool, - /** - * callback for end of component animation - */ - onAnimationEnd: PropTypes.func, - /** - * render a custom view that will appear permanently above or below a Toast, - * depends on the Toast's position, and animate with it when the Toast is made visible or dismissed - */ - renderAttachment: PropTypes.elementType, - /** - * render a custom loader component instead of the default when passing showLoader - */ - customLoader: PropTypes.func - }; - static defaultProps = { position: 'top', zIndex: 100 diff --git a/packages/react-native-ui-lib/src/components/wizard/types.ts b/packages/react-native-ui-lib/src/components/wizard/types.ts index 3ca8855b96..12b7b1e62b 100644 --- a/packages/react-native-ui-lib/src/components/wizard/types.ts +++ b/packages/react-native-ui-lib/src/components/wizard/types.ts @@ -77,7 +77,7 @@ export interface WizardProps { */ activeIndex: number; /** - * The configuration of the active step (see Wizard.Step.propTypes) + * The configuration of the active step */ activeConfig?: WizardStepProps; /** diff --git a/packages/react-native-ui-lib/src/components/wizard/wizard.api.json b/packages/react-native-ui-lib/src/components/wizard/wizard.api.json index ac84d739a9..7fe3ae2d98 100644 --- a/packages/react-native-ui-lib/src/components/wizard/wizard.api.json +++ b/packages/react-native-ui-lib/src/components/wizard/wizard.api.json @@ -17,7 +17,7 @@ { "name": "activeConfig", "type": "WizardStepProps", - "description": "The configuration of the active step (see Wizard.Step.propTypes)" + "description": "The configuration of the active step" }, { "name": "onActiveIndexChanged", diff --git a/yarn.lock b/yarn.lock index 8bcfd171eb..b85b182b8b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2615,13 +2615,6 @@ __metadata: languageName: node linkType: hard -"@react-native/normalize-color@npm:*": - version: 2.1.0 - resolution: "@react-native/normalize-color@npm:2.1.0" - checksum: 10c0/95814a1e2aac9c00dfc2c65f9e2caec07f70d3dba903b5640f5cf24605bf39863e572f2a5138a85d1c514fb3c33f6931595e0a9f738a58b5c220ee74f2bec13b - languageName: node - linkType: hard - "@react-native/normalize-colors@npm:0.78.3": version: 0.78.3 resolution: "@react-native/normalize-colors@npm:0.78.3" @@ -4962,17 +4955,6 @@ __metadata: languageName: node linkType: hard -"deprecated-react-native-prop-types@npm:^2.3.0": - version: 2.3.0 - resolution: "deprecated-react-native-prop-types@npm:2.3.0" - dependencies: - "@react-native/normalize-color": "npm:*" - invariant: "npm:*" - prop-types: "npm:*" - checksum: 10c0/a4bf78dde109cd1a706206fa6e06f7c44e70bc327b990f0f7f936d5d0b8a2372bc78e09979fb2e84bbc5233774aca4165b3ecd17a74765ccc11cead4827380ca - languageName: node - linkType: hard - "destroy@npm:1.2.0": version: 1.2.0 resolution: "destroy@npm:1.2.0" @@ -6640,7 +6622,7 @@ __metadata: languageName: node linkType: hard -"invariant@npm:*, invariant@npm:^2.2.4": +"invariant@npm:^2.2.4": version: 2.2.4 resolution: "invariant@npm:2.2.4" dependencies: @@ -9324,7 +9306,7 @@ __metadata: languageName: node linkType: hard -"prop-types@npm:*, prop-types@npm:15.8.1, prop-types@npm:15.x.x, prop-types@npm:^15.5.10, prop-types@npm:^15.8.1": +"prop-types@npm:15.8.1, prop-types@npm:15.x.x, prop-types@npm:^15.5.10, prop-types@npm:^15.8.1": version: 15.8.1 resolution: "prop-types@npm:15.8.1" dependencies: @@ -9738,7 +9720,6 @@ __metadata: color: "npm:^3.1.0" commons-validator-js: "npm:^1.0.237" date-fns: "npm:^2.29.3" - deprecated-react-native-prop-types: "npm:^2.3.0" hoist-non-react-statics: "npm:^3.0.0" jest: "npm:^29.6.3" light-date: "npm:^1.2.0" @@ -9749,7 +9730,6 @@ __metadata: postcss: "npm:^8.4.21" postcss-js: "npm:^4.0.0" prettier: "npm:^3.2.5" - prop-types: "npm:^15.5.10" react: "npm:19.0.0" react-autobind: "npm:^1.0.6" react-dom: "npm:19.0.0" From 6aba785ffbe41b9392f27d032fd873171ff94a8a Mon Sep 17 00:00:00 2001 From: M-i-k-e-l Date: Wed, 31 Dec 2025 13:34:51 +0200 Subject: [PATCH 3/4] Remove @types/prop-types --- expoDemo/package.json | 2 +- package.json | 1 - packages/react-native-ui-lib/package.json | 1 - yarn.lock | 9 --------- 4 files changed, 1 insertion(+), 12 deletions(-) diff --git a/expoDemo/package.json b/expoDemo/package.json index 549f9f6169..d4ad8dd4c8 100644 --- a/expoDemo/package.json +++ b/expoDemo/package.json @@ -36,7 +36,7 @@ "@react-native-community/cli": "15.0.1", "@react-native-community/cli-platform-android": "15.0.1", "@react-native-community/cli-platform-ios": "15.0.1", - "@types/react": "~18.3.24", + "@types/react": "19.0.0", "typescript": "^4.9.5" }, "private": true diff --git a/package.json b/package.json index e46440ee18..dd3b870cf1 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,6 @@ "@types/hoist-non-react-statics": "^3.3.1", "@types/jest": "^29.5.13", "@types/lodash": "^4.0.0", - "@types/prop-types": "^15.5.3", "@types/react": "19.0.0", "@types/react-test-renderer": "^19.0.0", "@types/tinycolor2": "^1.4.2", diff --git a/packages/react-native-ui-lib/package.json b/packages/react-native-ui-lib/package.json index 0a3920c2ff..3e7deda6fb 100644 --- a/packages/react-native-ui-lib/package.json +++ b/packages/react-native-ui-lib/package.json @@ -69,7 +69,6 @@ "@types/hoist-non-react-statics": "^3.3.1", "@types/jest": "^29.5.13", "@types/lodash": "^4.0.0", - "@types/prop-types": "^15.5.3", "@types/react": "19.0.0", "@types/react-test-renderer": "19.0.0", "@types/tinycolor2": "^1.4.2", diff --git a/yarn.lock b/yarn.lock index b85b182b8b..47ce15a578 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3063,13 +3063,6 @@ __metadata: languageName: node linkType: hard -"@types/prop-types@npm:^15.5.3": - version: 15.7.13 - resolution: "@types/prop-types@npm:15.7.13" - checksum: 10c0/1b20fc67281902c6743379960247bc161f3f0406ffc0df8e7058745a85ea1538612109db0406290512947f9632fe9e10e7337bf0ce6338a91d6c948df16a7c61 - languageName: node - linkType: hard - "@types/react-test-renderer@npm:19.0.0": version: 19.0.0 resolution: "@types/react-test-renderer@npm:19.0.0" @@ -9656,7 +9649,6 @@ __metadata: "@types/hoist-non-react-statics": "npm:^3.3.1" "@types/jest": "npm:^29.5.13" "@types/lodash": "npm:^4.0.0" - "@types/prop-types": "npm:^15.5.3" "@types/react": "npm:19.0.0" "@types/react-test-renderer": "npm:^19.0.0" "@types/tinycolor2": "npm:^1.4.2" @@ -9708,7 +9700,6 @@ __metadata: "@types/hoist-non-react-statics": "npm:^3.3.1" "@types/jest": "npm:^29.5.13" "@types/lodash": "npm:^4.0.0" - "@types/prop-types": "npm:^15.5.3" "@types/react": "npm:19.0.0" "@types/react-test-renderer": "npm:19.0.0" "@types/tinycolor2": "npm:^1.4.2" From caeb9dcff69dfa8feade91351b9e641f05395e1a Mon Sep 17 00:00:00 2001 From: Miki Leib <38354019+M-i-k-e-l@users.noreply.github.com> Date: Wed, 7 Jan 2026 10:11:01 +0200 Subject: [PATCH 4/4] Infra/v9 default props (#3901) * Remove unneeded defaultProps * defaultProps on asBaseComponent * Remove defaultProps (unused af far as we can tell) * Remove DocsGenerator (unused) * Fix (most) typescript issue (#3902) * Fix (most) typescript issue * Infra/v9 tests (#3903) * Fix button and update @testing-library/react-native version * Remove unsupported modifiers methods, add docs and fix tests The old TextField was the only usage of the removed methods and it was only used by MaskedInput which is deprecated --- docs/getting-started/v8.md | 3 +- docs/getting-started/v9.md | 21 + package.json | 7 +- packages/react-native-ui-lib/package.json | 4 +- .../src/commons/__tests__/modifiers.spec.js | 36 - .../src/commons/asBaseComponent.tsx | 3 +- .../src/commons/baseComponent.tsx | 2 - .../src/commons/forwardRef.tsx | 3 - .../src/commons/modifiers.ts | 21 - .../src/commons/withScrollEnabler.tsx | 2 - .../src/commons/withScrollReached.tsx | 2 - .../components/button/__tests__/index.spec.js | 118 ++- .../src/components/featureHighlight/index.tsx | 2 - .../src/components/hint/HintMockChildren.tsx | 2 +- .../src/components/hint/HintOld.tsx | 2 +- .../src/components/icon/index.tsx | 3 - .../src/components/image/index.tsx | 14 +- .../__tests__/maskedInput.old.spec.tsx | 20 - ...nput.new.spec.tsx => maskedInput.spec.tsx} | 4 +- .../src/components/maskedInput/index.tsx | 137 +++- .../maskedInput/maskedInput.api.json | 1 - .../src/components/maskedInput/new.tsx | 129 ---- .../src/components/maskedInput/old.js | 82 -- .../src/components/numberInput/index.tsx | 2 +- .../picker/__tests__/index.spec.tsx | 12 +- .../src/components/picker/types.ts | 1 - .../src/components/scrollBar/index.tsx | 23 +- .../src/components/textFieldOld/index.tsx | 711 ------------------ .../src/components/view/index.tsx | 3 +- .../src/helpers/DocsGenerator.js | 61 -- .../src/hooks/useCombinedRefs/index.ts | 1 - .../src/typings/module.d.ts | 15 +- yarn.lock | 135 +++- 33 files changed, 375 insertions(+), 1207 deletions(-) create mode 100644 docs/getting-started/v9.md delete mode 100644 packages/react-native-ui-lib/src/components/maskedInput/__tests__/maskedInput.old.spec.tsx rename packages/react-native-ui-lib/src/components/maskedInput/__tests__/{maskedInput.new.spec.tsx => maskedInput.spec.tsx} (87%) delete mode 100644 packages/react-native-ui-lib/src/components/maskedInput/new.tsx delete mode 100644 packages/react-native-ui-lib/src/components/maskedInput/old.js delete mode 100644 packages/react-native-ui-lib/src/components/textFieldOld/index.tsx delete mode 100644 packages/react-native-ui-lib/src/helpers/DocsGenerator.js diff --git a/docs/getting-started/v8.md b/docs/getting-started/v8.md index 1a29754cd7..820d60455f 100644 --- a/docs/getting-started/v8.md +++ b/docs/getting-started/v8.md @@ -1,5 +1,5 @@ --- -sidebar_position: 5 +sidebar_position: 6 sidebar_label: Migrating v7 -> v8 title: "Migrating v7 -> v8" # path: "/getting-started/v8" @@ -7,6 +7,7 @@ title: "Migrating v7 -> v8" ## `react-native-ui-lib@8.x.x` ## General +Now supports react-native 0.77 `uilib-native` (our native library) has been moved from `dependencies` to `peerDependencies`. Make sure to `pod install` after updating. We do plan on making this optional in the future. diff --git a/docs/getting-started/v9.md b/docs/getting-started/v9.md new file mode 100644 index 0000000000..31dcbda645 --- /dev/null +++ b/docs/getting-started/v9.md @@ -0,0 +1,21 @@ +--- +sidebar_position: 7 +sidebar_label: Migrating v8 -> v9 +title: "Migrating v8 -> v9" +# path: "/getting-started/v9" +--- +## `react-native-ui-lib@9.x.x` + +## General +Now supports react-native 0.78 and React 19 + +## Components + +### MaskedInput +Only the newer version is now available (the `migrate` prop is removed) + +## Utils + +### modifiers +extractOwnProps - removed +extractComponentProps - removed diff --git a/package.json b/package.json index fd64125a84..afa75f8de9 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "ios": "yarn workspace react-native-ui-lib ios", "android": "yarn workspace react-native-ui-lib android", "iPad": "yarn workspace react-native-ui-lib iPad", - "test": "yarn lint && yarn workspace react-native-ui-lib test", + "test": "yarn workspace react-native-ui-lib test", + "pretest": "yarn lint", "lint": "eslint packages -c .eslintrc.js --ext .tsx,.ts,.js", "lint:fix": "eslint packages -c .eslintrc.js --fix", "build:dev": "tsc --p tsconfig.dev.json", @@ -40,8 +41,8 @@ "@react-native/metro-config": "0.78.3", "@react-native/typescript-config": "0.78.3", "@shopify/flash-list": "1.7.6", - "@testing-library/react-native": "^11.5.1", - "@types/hoist-non-react-statics": "^3.3.1", + "@testing-library/react-native": "^13.3.3", + "@types/hoist-non-react-statics": "^3.3.7", "@types/jest": "^29.5.13", "@types/lodash": "^4.0.0", "@types/react": "19.0.0", diff --git a/packages/react-native-ui-lib/package.json b/packages/react-native-ui-lib/package.json index 95f880812a..462e5cb44c 100644 --- a/packages/react-native-ui-lib/package.json +++ b/packages/react-native-ui-lib/package.json @@ -64,8 +64,8 @@ "@react-native/metro-config": "0.78.3", "@react-native/typescript-config": "0.78.3", "@shopify/flash-list": "1.7.6", - "@testing-library/react-native": "^11.5.1", - "@types/hoist-non-react-statics": "^3.3.1", + "@testing-library/react-native": "^13.3.3", + "@types/hoist-non-react-statics": "^3.3.7", "@types/jest": "^29.5.13", "@types/lodash": "^4.0.0", "@types/react": "19.0.0", diff --git a/packages/react-native-ui-lib/src/commons/__tests__/modifiers.spec.js b/packages/react-native-ui-lib/src/commons/__tests__/modifiers.spec.js index 789bf2d07d..310a601b27 100644 --- a/packages/react-native-ui-lib/src/commons/__tests__/modifiers.spec.js +++ b/packages/react-native-ui-lib/src/commons/__tests__/modifiers.spec.js @@ -282,24 +282,6 @@ describe('Modifiers', () => { }); }); - // describe('extractOwnProps', () => { - // it('should extract the component props from a props object', () => { - // const props = {color: 'red', topShadow: 1, bottomShadow: 2}; - // expect(MultipleShadow.extractOwnProps(props)).toEqual({ - // topShadow: 1, - // bottomShadow: 2, - // }); - // }); - - // it('should omit props that were required to ignore', () => { - // const props = {color: 'red', topShadow: 1, bottomShadow: 2}; - // expect(MultipleShadow.extractOwnProps(props, 'topShadow')).toEqual({ - // bottomShadow: 2, - // }); - // expect(MultipleShadow.extractOwnProps(props, ['topShadow', 'bottomShadow'])).toEqual({}); - // }); - // }); - describe('extractModifiersProps', () => { it('should return all modifiers props', () => { expect(uut.extractModifierProps({ @@ -343,24 +325,6 @@ describe('Modifiers', () => { }); }); - describe('extractOwnProps', () => { - it('should extract the component props from a props object', () => { - const props = {color: 'red', prop1: 'text', prop2: 2}; - expect(uut.extractOwnProps.bind(SampleComponent)(props)).toEqual({ - prop1: 'text', - prop2: 2 - }); - }); - - it('should omit props that were required to ignore', () => { - const props = {color: 'red', prop1: 'text', prop2: 2}; - expect(uut.extractOwnProps.bind(SampleComponent)(props, 'prop1')).toEqual({ - prop2: 2 - }); - expect(uut.extractOwnProps.bind(SampleComponent)(props, ['prop1', 'prop2'])).toEqual({}); - }); - }); - describe('getThemeProps', () => { beforeEach(() => { ThemeManager.setComponentTheme('SampleComponent', undefined); diff --git a/packages/react-native-ui-lib/src/commons/asBaseComponent.tsx b/packages/react-native-ui-lib/src/commons/asBaseComponent.tsx index 26c1704a89..bcdb696f42 100644 --- a/packages/react-native-ui-lib/src/commons/asBaseComponent.tsx +++ b/packages/react-native-ui-lib/src/commons/asBaseComponent.tsx @@ -55,7 +55,7 @@ function asBaseComponent(WrappedCompone }; static getDerivedStateFromError(error: any) { - UIComponent.defaultProps?.onError?.(error, WrappedComponent.defaultProps); + UIComponent.defaultProps?.onError?.(error); return {error: true}; } @@ -80,6 +80,7 @@ function asBaseComponent(WrappedCompone hoistStatics(BaseComponent, WrappedComponent); BaseComponent.displayName = WrappedComponent.displayName; BaseComponent.propTypes = WrappedComponent.propTypes; + // @ts-expect-error class component have defaultProps and functions do not and so should not be affected by this BaseComponent.defaultProps = WrappedComponent.defaultProps; const ThemeContext = ThemeManager.getThemeContext(); if (ThemeContext) { diff --git a/packages/react-native-ui-lib/src/commons/baseComponent.tsx b/packages/react-native-ui-lib/src/commons/baseComponent.tsx index 2ab4affa83..73bdad4672 100644 --- a/packages/react-native-ui-lib/src/commons/baseComponent.tsx +++ b/packages/react-native-ui-lib/src/commons/baseComponent.tsx @@ -10,8 +10,6 @@ export default function baseComponent(usePure: boolean): ComponentType { styles: any; view: any; - static extractOwnProps = Modifiers.extractOwnProps; - constructor(props: any) { super(props); if (!this.styles) { diff --git a/packages/react-native-ui-lib/src/commons/forwardRef.tsx b/packages/react-native-ui-lib/src/commons/forwardRef.tsx index 38b08d8bfa..526b7469c8 100644 --- a/packages/react-native-ui-lib/src/commons/forwardRef.tsx +++ b/packages/react-native-ui-lib/src/commons/forwardRef.tsx @@ -17,10 +17,7 @@ export default function forwardRef(WrappedC const ForwardedComponent = React.forwardRef(forwardRef); hoistStatics(ForwardedComponent, WrappedComponent); - //@ts-ignore ForwardedComponent.displayName = WrappedComponent.displayName; - //@ts-ignore - ForwardedComponent.defaultProps = WrappedComponent.defaultProps; return ForwardedComponent as typeof ForwardedComponent & STATICS; } diff --git a/packages/react-native-ui-lib/src/commons/modifiers.ts b/packages/react-native-ui-lib/src/commons/modifiers.ts index 1815b21305..7117654191 100644 --- a/packages/react-native-ui-lib/src/commons/modifiers.ts +++ b/packages/react-native-ui-lib/src/commons/modifiers.ts @@ -338,27 +338,6 @@ export function extractModifierProps(props: Dictionary) { return modifierProps; } -/** - * TODO: - * @deprecated switch to Modifiers#extractComponentProps - */ -export function extractOwnProps(props: Dictionary, ignoreProps: string[]) { - //@ts-ignore - const ownPropTypes = this.propTypes; - const ownProps = _.flow((props: Dictionary) => _.pickBy(props, (_value, key) => _.includes(Object.keys(ownPropTypes), key)), - props => _.omit(props, ignoreProps))(props); - - return ownProps; -} - -export function extractComponentProps(component: any, props: Dictionary, ignoreProps: string[] = []) { - const componentPropTypes = component.propTypes; - const componentProps = _.flow((props: Dictionary) => _.pickBy(props, (_value, key) => _.includes(Object.keys(componentPropTypes), key)), - props => _.omit(props, ignoreProps))(props); - - return componentProps; -} - export function getComponentName(componentDisplayName: string) { //@ts-ignore return componentDisplayName || this.displayName || this.constructor.displayName || this.constructor.name; diff --git a/packages/react-native-ui-lib/src/commons/withScrollEnabler.tsx b/packages/react-native-ui-lib/src/commons/withScrollEnabler.tsx index 2bdc77ebdc..8cd4e34fbb 100644 --- a/packages/react-native-ui-lib/src/commons/withScrollEnabler.tsx +++ b/packages/react-native-ui-lib/src/commons/withScrollEnabler.tsx @@ -69,8 +69,6 @@ function withScrollEnabler(WrappedComponent: React.Componen hoistStatics(ScrollEnabler, WrappedComponent); ScrollEnabler.displayName = WrappedComponent.displayName; - //@ts-ignore - ScrollEnabler.defaultProps = WrappedComponent.defaultProps; return forwardRef(ScrollEnabler) as any; } diff --git a/packages/react-native-ui-lib/src/commons/withScrollReached.tsx b/packages/react-native-ui-lib/src/commons/withScrollReached.tsx index ea1da67579..56fde6f8ef 100644 --- a/packages/react-native-ui-lib/src/commons/withScrollReached.tsx +++ b/packages/react-native-ui-lib/src/commons/withScrollReached.tsx @@ -92,8 +92,6 @@ function withScrollReached(WrappedComponent: React.Componen hoistStatics(ScrollReachedDetector, WrappedComponent); ScrollReachedDetector.displayName = WrappedComponent.displayName; - //@ts-ignore - ScrollReachedDetector.defaultProps = WrappedComponent.defaultProps; return forwardRef(ScrollReachedDetector) as any; } diff --git a/packages/react-native-ui-lib/src/components/button/__tests__/index.spec.js b/packages/react-native-ui-lib/src/components/button/__tests__/index.spec.js index 722978bfa2..61b6820f48 100644 --- a/packages/react-native-ui-lib/src/components/button/__tests__/index.spec.js +++ b/packages/react-native-ui-lib/src/components/button/__tests__/index.spec.js @@ -1,5 +1,5 @@ import React from 'react'; -import renderer from 'react-test-renderer'; +import {render} from '@testing-library/react-native'; import Button from '../index'; import View from '../../view'; import {Colors, ThemeManager} from '../../../style'; @@ -12,54 +12,54 @@ describe('Button', () => { }); it('should render default button', () => { - const tree = renderer.create(