|
| 1 | +--- |
| 2 | +sidebar_position: 5 |
| 3 | +sidebar_label: Migrating v6 -> v7 |
| 4 | +title: "Migrating v6 -> v7" |
| 5 | +# path: "/getting-started/v7" |
| 6 | +--- |
| 7 | + |
| 8 | + |
| 9 | +### Presets |
| 10 | + |
| 11 | +### ThemeManager |
| 12 | +ThemeManager doesn’t contain the following getters anymore: |
| 13 | +- `getTheme()` |
| 14 | +- `get primaryColor()` |
| 15 | +- `get CTATextColor()` |
| 16 | +- `get CTADisabledColor() ` |
| 17 | +- `get CTABackgroundColor()` |
| 18 | +- `get titleColor()` |
| 19 | +- `get subtitleColor()` |
| 20 | +- `get dividerColor()` |
| 21 | + |
| 22 | +Also, the theme now contains only the ‘primaryColor’ and the ‘compontns’ object. |
| 23 | + |
| 24 | +#### Colors |
| 25 | +‘Colors.primary’ is deprecated. Please use the design tokens instead, for example: |
| 26 | +instead of passing |
| 27 | + `style={{backgroundColor: Colors.primary}}` |
| 28 | +pass |
| 29 | + `style={{backgroundColor: Colors.$backgorundPrimaryHeavy}}` |
| 30 | + |
| 31 | +To generate the tokens based on your primary color, use: |
| 32 | + `Colros.loadDesignTokens({primaryColor: <your primary color>})` |
| 33 | + |
| 34 | +### Shadows |
| 35 | +The `dark` presets are deprecated. Please use the `grey` presets instead. |
| 36 | + |
| 37 | + |
| 38 | +### Dependencies |
| 39 | + |
| 40 | +#### typescript |
| 41 | +Minimum version of typescript is now ^4.9.5. |
| 42 | + |
| 43 | +### moment |
| 44 | +The `moment` package was removed from our dependencies and bacome an optional dependency for the `DateTimePicker` component (relevant only for `dateFormat` and `timeFormat` feature). |
| 45 | + |
| 46 | + |
| 47 | +### Components |
| 48 | + |
| 49 | +### Avatar |
| 50 | +`imageSource` prop is deprecated. Please use ‘source’ prop instead. |
| 51 | + |
| 52 | +### ChipsInput |
| 53 | +The component was deprecated and replaced by formar `Incubator.ChipsInput`. |
| 54 | + |
| 55 | +### ColorPicker |
| 56 | +`style` prop is deprecated. |
| 57 | + |
| 58 | +### DateTimePicker |
| 59 | +Migrate internal `TextField` component to the new implementation. See `TextField` migration below. |
| 60 | + |
| 61 | +### Drawer |
| 62 | +`leftToggleHapticTrigger` prop is deprecated. |
| 63 | + |
| 64 | +### Fader |
| 65 | +`FaderPosition` enum `LEFT` and `RIGHT` cases are deprecated. Please use `START` and `END` instead. |
| 66 | + |
| 67 | +### Incubator.Toast |
| 68 | +`zIndex` prop is now set to `100` as default on Android. |
| 69 | + |
| 70 | +### KeyboardAccessoryView |
| 71 | +`iOSScrollBehavior` prop and `iosScrollBehaviors` enum are deprecated. Please use `scrollBehavior` prop instead and pass it `KeyboardAccessoryView.scrollBehaviors`. |
| 72 | + |
| 73 | +### KeyboardAwareListView |
| 74 | +Component removed. Please use `KeyboardAwareScrollView` or `KeyboardAwareFlatList` components instead. |
| 75 | + |
| 76 | +### Picker |
| 77 | +`value` prop now accepts only `string` or `number` and not objects. |
| 78 | +`useNativePicker` renamed `useWheelPicker`. |
| 79 | +`renderNativePicker` prop was deprecated. |
| 80 | + |
| 81 | +### RadioButton |
| 82 | +`contentOnRight` prop is deprecated (the content is on right by default). |
| 83 | + |
| 84 | +### Skeleton |
| 85 | +`contentData` prop is deprecate. Please use the `customValue` prop. |
| 86 | +All the following props has been removed, you can send them inside the `listProps` prop: |
| 87 | +- `size` |
| 88 | +- `contentType` |
| 89 | +- `hideSeparator` |
| 90 | +- `showLastSeparator` |
| 91 | + |
| 92 | +### TabBar |
| 93 | +Component removed. Please use `TabController` component instead. |
| 94 | + |
| 95 | +### TabController |
| 96 | +`selectedIndex` prop is deprecated. Please use `initialIndex` prop instead. |
| 97 | + |
| 98 | +### TextField |
| 99 | +The component was refactored completely with a new API. |
| 100 | + |
| 101 | +Props migration: |
| 102 | +`helperText` -> `hint` |
| 103 | +`Title` -> `label` |
| 104 | +`titleColor`-> `labelColor` |
| 105 | +`titleStyle` -> `labelStyle` |
| 106 | +`showCharacterCounter` -> `showCharCounter` |
| 107 | +`transformer` -> `formatter` |
| 108 | +`prefix` -> `leadingAccessory` |
| 109 | +`prefixStyle` -> `leadingAccessory` |
| 110 | +`rightIconSource` -> `trailingAccessory` |
| 111 | +`rightIconStyle` -> `trailingAccessory` |
| 112 | +`rightButtonProps` -> `trailingAccessory` |
| 113 | +`leadingIcon` -> `leadingAccessory` |
| 114 | +`useTopErrors` -> `validationMessagePosition` |
| 115 | +`error` prop is deprecated. Please use `validationMessage` prop with `validate` prop. |
| 116 | +`expandable` prop is deprecated |
| 117 | +`renderExpandableInput` prop is deprecated |
| 118 | +`renderExpandable` prop is deprecated |
| 119 | +`onToggleExpandableModal` 'prop is deprecated |
| 120 | +`topBarProps` prop is deprecated |
| 121 | + |
| 122 | +Check full (and new) API: https://wix.github.io/react-native-ui-lib/docs/components/incubator/TextField |
| 123 | + |
| 124 | +### WheelPicker |
| 125 | +The WheelPicker component has a new implementation. |
| 126 | +The component is now uncontrolled and have some prop changes: |
| 127 | +`selectedValue` prop renamed `initialValue` (do not update unless it has been changed from non-user origin). |
| 128 | +`onValueChange` prop renamed `onChange`. |
| 129 | +Also, `children` can now be passed to the `items` prop (not mandatory). |
| 130 | + |
| 131 | +Check full (and new) API: https://wix.github.io/react-native-ui-lib/docs/components/incubator/WheelPicker |
0 commit comments