-
Notifications
You must be signed in to change notification settings - Fork 230
Open
Description
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
| 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;
}Metadata
Metadata
Assignees
Labels
No labels