I use image picker in react-native when i want preview selected image i receive error
"Invariant Violation: Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. Check the render method of
TrackScreen
."
I try to do it in simple project and works for me.
i use redux for navigation
this is my app code
import React, { Component } from "react";
import { createStackNavigator, createAppContainer } from "react-navigation";
import HomeScreen from "./screens/homeScreen";
import TrackScreen from "./screens/trackScreen";
import trackList from "./components/trackList";
import LoginScreen from "./screens/loginScreen";
import { Root } from "native-base";
import { navigationService } from "./services/navigation.service";
class BreAppAndroid extends Component {
render() {
return (
<Root>
<AppContainer ref={r => navigationService.setTopLevelNavigator(r)} />
</Root>
);
}
}
const StackNavigators = createStackNavigator(
{
Home: HomeScreen,
Track: TrackScreen,
Login: LoginScreen
},
{
initialRouteName: "Home",
defaultNavigationOptions: {
header: null
}
}
);
const AppContainer = createAppContainer(StackNavigators);
export default BreAppAndroid;