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

Static id in code example chapter 5 #56

Closed
dchisolm opened this issue Feb 2, 2020 · 1 comment
Closed

Static id in code example chapter 5 #56

dchisolm opened this issue Feb 2, 2020 · 1 comment

Comments

@dchisolm
Copy link

dchisolm commented Feb 2, 2020

Hi,

Checking out the preview book on O'Reilly, I ran across a small issue with the initial recipe.js example under "Break Components into Modules".

import React from "react";

function Recipe({name, ingredients, steps}) {
    return (<section id="baked-salmon"><h1>{name}</h1>
        <ul className="ingredients">        {ingredients.map((ingredient, i) => (
            <li key={i}>{ingredient.name}</li>))}      </ul>
        <section className="instructions"><h2>Cooking Instructions</h2>        {steps.map((step, i) => (
            <p key={i}>{step}</p>))}      </section>
    </section>);
}

Using this Recipe function, it appears every top level <section> would have an id of "baked-salmon". The examples leading up to this point "slugified" something for the id, but this example loves baked salmon specifically!

@eveporcello
Copy link
Member

Yeah good call, we fixed this before it went to print. Thanks for sending this along!

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

2 participants