https://snack.expo.io/@haosmark/kw-companion I'm having a hard time figuring this out. To start, I'm just trying to take a list of players and push it over to my starting screen.
A bit of explanation of what I've done so far:
- mockData.json is a file with the content that I'm trying to display
- App.js creates a few navigators and sets the starting point to be PlayerNavigator
- api.js is where I'm thinking of processing json content
- redux/reducers/player_reducer.js is how I try to get the player list (reducers are pretty difficult for me to understand right now, so I'm not sure what goes into these files yet.)
- screens/list.js is where I'm trying to connect redux to RN and read the player list.
At present, the code doesn't compile. My emulator screams that "players" returned undefined during initialization. Snack editor is screaming "Device: (78:20) Unable to resolve module 'module://mockData.js'" but I have no idea where it's even finding mockData.js since it isn't one of the files within the project.
Edit: I was able to figure out the .json problem for the snack, now the problem is the same as on the local emulator:
Device: (281:119) Reducer "players" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined. Evaluating module://redux/store/index.js