If I type wrong url, I will git error on page
EX:
http://localhost:3000/palette/&@#$%%

|
findPalette(id) { |
|
return this.state.palettes.find(function(palette) { |
|
return palette.id === id; |
|
}); |
|
} |
Maybe it could write this to fix issue
findPalette = id => {
const defaultPalette = colorsConfig[0];
return this.state.palettes.find(palette => palette.id === id) || defaultPalette;
}
If I type wrong url, I will git error on page
EX:
http://localhost:3000/palette/&@#$%%
react-colors/colors-app/src/App.js
Lines 21 to 25 in c358775
Maybe it could write this to fix issue