jeanverster / react-native-styled-toast

A theme friendly, easy to use react-native toast component built using styled-components and styled-system.
MIT License
315 stars 33 forks source link

Support for TypeScript #95

Open andrefangeloni opened 2 years ago

andrefangeloni commented 2 years ago

Hi there, I'm already installed this lib on my project with TS and I'm facing this error below:

Type '{ children: Element[]; position: "BOTTOM"; }' is not assignable to type 'IntrinsicAttributes & Omit<ToastContextType, "toast">'. Property 'children' does not exist on type 'IntrinsicAttributes & Omit<ToastContextType, "toast">'.

Follow my code:

import React from 'react';
import { Provider } from 'react-redux';
import { StatusBar } from 'react-native';
import { ToastProvider } from 'react-native-styled-toast';

import { Routes } from './routes/routes';

import store from './redux';

const App = () => (
  <Provider store={store}>
    <ToastProvider position="BOTTOM">
      <StatusBar backgroundColor="#000" />
      <Routes />
    </ToastProvider>
  </Provider>
);

export default App;

Thanks

w1ll-dev commented 2 years ago

same here

andrefangeloni commented 2 years ago

@mbukeRepo The problem is on ToastProvider don't expect to receive children by props. It seems no one is maintaining the lib =/