Tried to register two views with the same name ProgressBarAndroid

Using reactive version 16.0.0 with reaction version 0.49.1 causes a red screen error "I tried to register two views with the same name ProgressBarAndroid". Removing all imports and instances of ProgressBarAndroid results in a well-functioning program. Downgrading to version 0.48.4 based on the reaction also works. How to use ProgressBarAndroid with the latest version of React Native?

+5
source share
1 answer

React Native, starting with version 0.49, raises this error if you try to call requireNativeComponent() for the same component more than once. Even if they are called from different modules.

I had a similar problem with the custom view of MyCustomView . So I just wrapped it in one module:

 // MyCustomView.js import {requireNativeComponent} from 'react-native' const MyCustomView = requireNativeComponent('MyCustomView', null) export default MyCustomView 

Although this may not be your exact case, the main reason is the same.

+2
source

Source: https://habr.com/ru/post/1272409/


All Articles