Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMuhammad Ali
6,752 PointsCan anyone help men with this dev tool error
Warning: Received true
for a non-boolean attribute button
.
If you want to write it to the DOM, pass a string instead: button="true" or button={value.toString()}. in button (created by Counter) in div (created by Counter) in Counter (created by Player) in div (created by Player) in Player (created by App) in div (created by App) in App
Muhammad Ali
6,752 Pointsfunction Header(props){
return(
<header>
<h1>{ props.title }</h1>
<span className>Player:{props.totalPlayer}</span>
</header>
);
}
const Counter=()=>{
return(
<div className="counter">
<button button className="counter-action decrement">+</button>
<span button className="counter-score">35</span>
<button button className="counter-action decrement">-</button>
</div>
);
}
const Player=()=> {
return (
<div className="player">
<span className="player-name">
Ranjha Eleven
</span>
<Counter />
</div>
);
}
const App= ()=>{
return(
<div className="scoreboard">
<Header title={"SocreBoard"} totalPlayer={5}/>
{/* showing Playerlist*/}
<Player />
</div>
);
}
ReactDOM.render(
<App />,
document.getElementById('root')
);
1 Answer
Tim Oltman
7,730 PointsHi Muhammad,
It looks like there is a problem with your Counter component.
const Counter=()=>{
return(
<div className="counter">
<button button className="counter-action decrement">+</button>
<span button className="counter-score">35</span>
<button button className="counter-action decrement">-</button>
</div>
);
}
You have repeated "button" inside both of the button tags and the span tag. You should remove it to look like this:
const Counter=()=>{
return(
<div className="counter">
<button className="counter-action decrement">+</button>
<span className="counter-score">35</span>
<button className="counter-action decrement">-</button>
</div>
);
}
React is interpreting "button" within these tags as you trying to pass a boolean value into the element.
Nicole Antonino
12,834 PointsNicole Antonino
12,834 PointsYou need to show us the code you wrote that brought about this error.