Skip to content
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

Can't use overlay on react native #1522

Open
aminos02 opened this issue Nov 12, 2024 · 0 comments
Open

Can't use overlay on react native #1522

aminos02 opened this issue Nov 12, 2024 · 0 comments

Comments

@aminos02
Copy link

aminos02 commented Nov 12, 2024

Describe the bug

i have a simple react native app:

i have this config reactotron-config.js:

import AsyncStorage from '@react-native-async-storage/async-storage';
import Reactotron from 'reactotron-react-native';

Reactotron.configure({ name: 'Example App' })
  .setAsyncStorageHandler(AsyncStorage)
  .useReactNative({
    // Other configurations if necessary
    overlay: true,
    storybook: true,
  })
  .connect();

App.tsx:

import React from 'react';
import { AppRegistry, Text, View } from 'react-native';
import Reactotron, { overlay } from 'reactotron-react-native';

const App = () => {
  return (
    <View style={{ alignItems: 'center', flex: 1, justifyContent: 'center' }}>
      <Text>Hello</Text>
    </View>
  );
};

try {
  if (__DEV__) {
    // eslint-disable-next-line global-require
    require('../reactotron-config');
  }
  AppRegistry.registerComponent('Roshn SuperApp', () => overlay(App)); 
} catch {
  // eslint-disable-next-line no-console
  console.error('Error loading application');
}

i'm getting an error when i wrap my app with overlay :
Type '{ onCommand: (command: any) => void; features: { overlay: (WrappedComponent: ComponentType<{}>) => (props?: Record<string, any> | undefined) => Element; }; }' is not assignable to type 'ReactNode'

and if i use Reactotron.overlay i get an issue that overlay doesn't exist , and to note the network monitoring is working for me but i should remove overlay wrapper.

Reactotron version

"reactotron-react-native": "^5.1.9"

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

No branches or pull requests

1 participant