Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forgot to make 404 not found page #2

Open
ChaoTzuJung opened this issue Jun 24, 2019 · 0 comments
Open

Forgot to make 404 not found page #2

ChaoTzuJung opened this issue Jun 24, 2019 · 0 comments

Comments

@ChaoTzuJung
Copy link

ChaoTzuJung commented Jun 24, 2019

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

螢幕快照 2019-06-24 下午5 13 36

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;
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant