Better HN
topnewbestaskshowjobs
Log inSign up

krawaller

9 karma · joined Aug 30, 2014 (12y ago) · 7 submissions

Submissions

comment 12y ago · link · parent

There's now a follow-up to this post, walking through a refactor based on the comments given here and elsewhere. Thank you all for the feedback!

https://news.ycombinator.com/item?id=8273026

2.

Diving deeper into a React.js memory game case study(blog.krawaller.se ↗)

5 points · by krawaller · 12y ago · discuss

comment 12y ago · link · parent

Wow, thank you so much for this! Reading through your changes I do feel a bit silly. And wiser! :)

comment 12y ago · link · parent

The not doing anything is intentional - only when the pair is resolved and the status row goes back to saying "choose a tile" can you click a new tile. This "feature" really needs to be communicated better though, sorry abouy that.

comment 12y ago · link · parent

I touch on this in a post - I did try the latter, but got a React warning in the console about unmounted components. That, together with a comment in the official docs, made me go with the show/hide approach.

Although as pointed out in the Disqus comment, choosingg what to render is also fine, I probably did something silly stemming from not fully understanding the component life cycle.

comment 12y ago · link · parent

Might be I've been sloppy with adding -moz- to some css rules. Will take a look!

comment 12y ago · link · parent

Oh, indeed, I've completely missed the classSet plugin! That would indeed make the code more elegant. And fair point about the logic perhaps being too complicated here.

Thanx for the pointers!