Malawi-DCCMS / weather-app

An app to show the weather.
0 stars 0 forks source link

Refactored code to avoid unserializable objects sent to either redux … #186

Closed havardf closed 6 days ago

havardf commented 1 week ago

…or navigator.

danielmwakanema commented 6 days ago

@havardf, I am still getting the non-serializable values warning when I click the "Today" card.

danielmwakanema commented 6 days ago

This is the warning I get:

WARN  Non-serializable values were found in the navigation state. Check:

Hourly > params.daySummary.day._zone.constructor (Function)

This can break usage such as persisting and restoring state. This might happen if you passed non-serializable values such as function, class instances etc. in params. If you need to use components with callbacks in your options, you can use 'navigation.setOptions' instead. See https://reactnavigation.org/docs/troubleshooting#i-get-the-warning-non-serializable-values-were-found-in-the-navigation-state for more details. 
    at BaseNavigationContainer (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.zanyengo&modulesOnly=false&runModule=true:173559:28)
    at ThemeProvider (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.zanyengo&modulesOnly=false&runModule=true:179376:21)
    at NavigationContainerInner (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.zanyengo&modulesOnly=false&runModule=true:179264:26)
    at App
    at ThemeProvider (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.zanyengo&modulesOnly=false&runModule=true:168216:38)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.zanyengo&modulesOnly=false&runModule=true:59837:43)
    at Portal.Host (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.zanyengo&modulesOnly=false&runModule=true:165412:36)
    at RNCSafeAreaProvider
    at SafeAreaProvider (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.zanyengo&modulesOnly=false&runModule=true:157515:24)
    at SafeAreaProviderCompat (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.zanyengo&modulesOnly=false&runModule=true:157415:24)
    at PaperProvider (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.zanyengo&modulesOnly=false&runModule=true:157307:37)
    at Provider (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.zanyengo&modulesOnly=false&runModule=true:171324:21)
    at Main
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.zanyengo&modulesOnly=false&runModule=true:59837:43)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.zanyengo&modulesOnly=false&runModule=true:59837:43)
    at AppContainer (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.zanyengo&modulesOnly=false&runModule=true:59681:36)
    at Zanyengo(RootComponent) (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.zanyengo&modulesOnly=false&runModule=true:108451:28)
havardf commented 6 days ago

@danielmwakanema This is strange. I don't get this log and params.daySummary.day in the Hourly screen does not exist in the code anymore, as far as I can see? Maybe there some caching issues in the build artifacts, so your emulator run old code?

danielmwakanema commented 6 days ago

@havardf, I pulled from this branch again and everything is in order, :). LGTM.

danielmwakanema commented 6 days ago

Merging...