Skip to content

0.13

Compare
Choose a tag to compare
@necolas necolas released this 26 Jun 22:17
· 460 commits to master since this release

This release includes many significant changes and improvements.

  1. Modern React: implements components using function components and hooks. It removes use of various legacy React features such as legacy context and create-react-class. These changes mean better support for Concurrent Mode, Fast Refresh, and interaction handling.
  2. Gesture Responder System: this has be rewritten from scratch in user space. Dozens of bugs have been fixed and the system is heavily unit tested; it's now the most accurate and well integrated implementation of any platform.
  3. React Alternatives: this release removes the use of unstable React DOM APIs. React Native for Web can now be used with Preact and other libraries that are API compatible with React. However, it should be noted that benchmark rendering of 0.13 with React DOM is a lot faster than Preact.

Breaking changes

  • The Responder System has been rewritten. This should not be a breaking change (and comes with many bug fixes), but since the system is implemented in user-space rather than React, it may encounter differences in timings relative to the ReactDOM events.
  • The onPress callback on Touchables is now backed by native click events and will be called in almost every situation a native click event is called. The onPress prop of Touchable* components now receives a SyntheticMouseEvent not a SyntheticResponderEvent. It may be fired without a preceding onPressIn.
  • All the components are implemented as function components, so using findNodeHandle to get a reference to the component's underlying host node will not work. Use ref instead. The findNodeHandle and findDOMNode APIs are discouraged and are not safe with function components or concurrent mode.
  • The forwardedRef props have been removed. The ref on a component will now return a ref to the host node, which has the imperative methods attached to it.
  • The hitSlop prop has been removed. This caused incorrect hit targets for mouse interactions. The browser's built-in touch hitslop will be relied on instead.
  • The prop types of each component are now explicit. Unknown props will not be forwarded to the underlying React DOM component.
  • Forwarding of data-* props is no longer supported. Use dataSet instead. For example, dataSet={{ someName: 1 }}.
  • The onLayout prop now requires a ResizeObserver polyfill to work, and does not fallback to window resize events.
  • Removed React Native APIs that have been removed or deprecated: TabBarIOS, TimePickerAndroid
  • Removed support for HTML microdata props. Microdata has been removed from the HTML spec.
  • Removed the accessibilityRelationship prop. This prop was not added to React Native. Continue using aria-* props for now.

New features

  • Added View support for accessibilityValue.
  • Added the Pressable component.
  • Add the Appearance API and useColorScheme hook.

Fixes

  • The active touch responder will now be terminated when the body scrolls, context menu appears, etc.
  • Performance improvements for Touchables.
    The onPress event can now be used to preventDefault the native click behavior (this is no longer done automatically)
  • Fixes Image support for variable resolution images (requires bundler integration).
  • Fixes TextInput support for onContentSizeChange to allow auto-grow textareas.
  • Fixes the correctness of setting styles using ref.setNativeProps. Recommend avoiding this API as it is expected to be deprecated in React Native.