Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
very nice
It would be nice if this kata didn't force people to use outdated class components
This comment is hidden because it contains spoiler information about the solution
This solution works but will not pass the tests
import React from 'react';
export class Counter extends React.Component {
constructor(props) {
// Your state
super(props);
this.state = {counter: 0};
}
handleClick(event) {
}
// Your event handlers
render() {
return (
counter: {this.state.counter}
Decrement
Increment
)
}
}
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
yea, struggled with that too for the ungodly amount of time until realized that i am missing ids which i didnt think this kata checks for...Had to look at test cases to figure it out. good learning experience though!
Thanks for the suggestion, I've added tests for the existence of those id's so it should give better errors now!
I think in this kata it's more helpful to have separate tests for the existence of
#counter
,#increment
and#decrement
, otherwise there are errors when they're used and the error message is quite cryptic.excecuteRender function removed from the tests.
Thanks, added docs to the readme and removed the onClick handlers from the initial solution.
I noticed in the start solution file the
onClick
handlers are set on the button.I was thinking they should be removed and let the trainee implement them on the button so they can try themselves. I think this will provide better learning.
Also explaining more about ReactJS event handles in the description with an example to help the trainee.
The React docs has good examples about events https://reactjs.org/docs/handling-events.html
Noticed the function
executeRender
in the test is not used.Loading more items...