Easier way to register RNN components.
npm install react-native-navigation-register-screensEasier way to register RNN components.
``tsx
import {
ScreenFC,
} from 'react-native-navigation-register-screens';
type MyFunctionComponentProps = {
hello: string,
};
const MyFunctionComponent: ScreenFC
hello,
componentId,
}) {
console.log(componentId);
return (
);
};
MyFunctionComponent.screenName = 'MyApp.Screens.MyFunctionComponent';
MyFunctionComponent.options = props => {
console.log(props);
return {
topBar: {
title: {
text: 'Pushed screen title',
},
},
};
};
`
`ts
import {registerScreens} from 'react-native-navigation-register-screens';
registerScreens([MyFunctionComponent, MyClassComponent, MyPureComponent]);
`
If your using react-redux's Provider or other similar libraries, you can provide a third parameter as the callback function.
`tsx
import {Provider} from 'react-redux';
import store from '../store';
registerScreens(
[MyFunctionComponent, MyClassComponent, MyPureComponent],
(Component) => (props) => (
),
);
`
react-native-navigation-register-screens` is MIT licensed, as found in the LICENSE file.