I am using flagpack-react to render flags based on country code passed by our end. Looks like we have mismatch for some country alpha 2 codes, but instead of breaking applicaiton, it would be better to return null from the Flag component
Your Environment
Version used: react-flagpack: ^0.1.1
Browser Name and version: Chrome
Operating System and version (desktop or mobile): MacOS
Please check all that apply
Expected Behavior
JS error shouldn't break whole application, can return undefined instead of breaking app
Current Behavior
Breaking app in case there is not country related to passed country code
Possible Solution
Issue is here: https://github.com/Yummygum/flagpack-core/blob/55fb55406047321c611b1e8a9738775175b24ee7/index.js#L10 Would be better to check if country has found before trying to get
[keyToGet]
Steps to Reproduce
Pass unrelated code or
GB
for UKScreenshots
Context
I am using
flagpack-react
to render flags based on country code passed by our end. Looks like we have mismatch for some country alpha 2 codes, but instead of breaking applicaiton, it would be better to return null from theFlag
componentYour Environment