Home > database >  Gets undefined when i pass a title as props
Gets undefined when i pass a title as props

Time:01-22

when i'm trying to pass the title like this

CodePudding user response:

Try using shelfTitle in lowercase instead like

const BookShelf =({shelfBooks,shelfTitle,handelChange})=>{


    return (
        <div className="bookshelf">
                <h2 className="bookshelf-title" value={ShelfTitle}>{shelfTitle} shelfTitle</h2>

This is because React follows the convention of using camelCase for naming props and state variables.

  • Related