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 trialAnthony Ogounchi
Full Stack JavaScript Techdegree Graduate 14,594 PointsI am getting this error TypeError: props.changeScore is not a function
I am asking the question again because I am getting the same error and even though the question has already been asked previously, there was no answer provided to it.
import React from 'react';
const Counter = (props) => {
let index = props.index;
return (
<div className="counter">
<button className="counter-action decrement" onClick={() => props.changeScore(index, -1)}> - </button>
<span className="counter-score">{ props.score }</span>
<button className="counter-action increment" onClick={() => props.changeScore(index, +1)}> + </button>
</div>
);
}
export default Counter;
1 Answer
Anthony Ogounchi
Full Stack JavaScript Techdegree Graduate 14,594 PointsItβs due to an error in App.js. Already spotted and fixed.
KRIS NIKOLAISEN
54,972 PointsKRIS NIKOLAISEN
54,972 PointsThe code you have appears to match the video. You will probably have to post more than this. Can you post App.js?