Skip to content

Appbar.Header require a deprecated library #4362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yhojann-cl opened this issue Apr 2, 2024 · 2 comments
Closed

Appbar.Header require a deprecated library #4362

yhojann-cl opened this issue Apr 2, 2024 · 2 comments
Labels

Comments

@yhojann-cl
Copy link

Have a single example using React Native Papper:

import React, { Component } from 'react';
import { Appbar, PaperProvider } from 'react-native-paper';

class App extends Component {

    render() {
        return (
            <PaperProvider>
                <Appbar.Header>
                    <Appbar.BackAction onPress={() => {}} />
                    <Appbar.Content title="Title" />
                    <Appbar.Action icon="magnify" onPress={() => {}} />
                    <Appbar.Action icon="dots-vertical" onPress={() => {}} />
                </Appbar.Header>
            </PaperProvider>
        );
    }
}

export default App;

When run says:

 ERROR  Invariant Violation: requireNativeComponent: "RNCSafeAreaProvider" was not found in the UIManager.

This error is located at:
    in RNCSafeAreaProvider (created by SafeAreaProvider)
    in SafeAreaProvider (created by SafeAreaInsetsContext)
    in SafeAreaProviderCompat (created by PaperProvider)
    in PaperProvider (created by App)
    in App
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in app(RootComponent), js engine: hermes

I found a manually patch to solve problem installing react-native-safe-area-context package: react-navigation/react-navigation#8964

But when compile says:

Task :react-native-safe-area-context:processDebugManifest
package="com.th3rdwave.safeareacontext" found in source AndroidManifest.xml: /.../app/node_modules/react-native-safe-area-context/android/src/main/AndroidManifest.xml.
Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported, and the value is ignored.
Recommendation: remove package="com.th3rdwave.safeareacontext" from the source AndroidManifest.xml: /.../app/node_modules/react-native-safe-area-context/android/src/main/AndroidManifest.xml.
...
Task :react-native-safe-area-context:compileDebugKotlin
w: file:///.../app/node_modules/react-native-safe-area-context/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaContextModule.kt:7:46 'ReactModule' is deprecated. Deprecated in Java

The Appbar.Header component require a deprecated non preinstalled library to work?

@yhojann-cl yhojann-cl added the bug label Apr 2, 2024
@gedu
Copy link
Contributor

gedu commented Apr 3, 2024

Hey, did you installed npm install react-native-safe-area-context?
Did you try to add the SafeAreaProvider?

<SafeAreaProvider>
       <PaperProvider>
                <Appbar.Header>
                    <Appbar.BackAction onPress={() => {}} />
                    <Appbar.Content title="Title" />
                    <Appbar.Action icon="magnify" onPress={() => {}} />
                    <Appbar.Action icon="dots-vertical" onPress={() => {}} />
                </Appbar.Header>
         </PaperProvider>
</SafeAreaProvider>   

@yhojann-cl
Copy link
Author

yhojann-cl commented Apr 4, 2024

Yes, the package react-native-safe-area-context and use a safe area component but have a deprecated components and does not work all. Why not include by default the safe area and safe area context by default in the package if it is required to works?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants