Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Forgot to make 404 not found page #2

@ChaoTzuJung

Description

@ChaoTzuJung

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;
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions