-
Notifications
You must be signed in to change notification settings - Fork 566
Learn advanced react and provide feedback on the workshop #6
Comments
First of all this is extremely valuable! Thanks for all the effort. I worked throw it on codesandbox (Great platform for these courses). Some of my findings: 02.js// The button will be responsible for rendering the <Switch /> (with the right pros) Not quite sure but I think this should be 03.js// 💰: You'll need to move this below the `toggle` function. See
// if you can figure out why :) Figured it out but would be nice to have a little explanation in the final version. 06.jsEven for the final version I get this error when clicking on the "on"/"off" button under the switch:
07.jsIn line 09.jsI would document the reasoning behind introducing 10.jsThere is another // We'll need a `getState` method here that returns a state object
// which has properties I would add a 🐨to make it clear that the 10-primer.jsI would switch the order between I find it very rewarding to work through these tiny problem sets. I can clearly see each piece of information fit right into each other. The amount of "work" in each step is perfectly measured and doesn't lead to any frustration. Just one thing I don't really get. There are are some places where you are using 🐨as a marker for "work" and other times there is plain It really shows that this is v2, astonishing how incredible the pacing of this is. Thanks for creating such great content! Looking forward of doing the rest of it tonight. |
Thank you so much @FWeinb! This is very valuable feedback!
You're right, that's a typo. PR anyone?
Yeah, perhaps I should explain it in some comments 👍
That appears to be a bug. I'll need to look into it (or anyone else is welcome to address it in a PR if you so desire).
Anything that's |
Glad you find this feedback valuable. I added my remaining thoughts on the other exercises. I could make a PR to fix these issues if you would like. |
Thanks a ton!
Yes, the naming is unfortunate. I totally understand what you're saying. I'll improve that.
Great point. I'll make that more clear 👍
Good points. I'll make that more clear too.
That was a mistake. 10-primer.js is supposed to come before 10.js. Sorry 😅 Thanks again! |
01 to 09.jsThese excersises are good to do with your comments in the code. 10.jsFor me it is still difficult to follow how the 13.jsThere is a "typo" in Also the commented import statement for Redux would be good at this example and also a brief description what the component should do would be great. I like the idea of using Redux like in this example but I'm not sure if this is best practice. I think it's better to use one Redux store and use the Redux provider and connect the component to that store. My thoughts to the workshopYou did a great job here. It was fun to work my way through it. Thanks for your work. A possible improvement: |
Thank you so much for the help @AWolf81!
I think that I'll refactor from using the
Rendux isn't really intended to be a best practice or anything. People can implement it however they like. So I'm not entirely concerned about that bit so long as it works :)
Did you notice that there actually are unit tests for each exercise? As noted in the README you're supposed to swap the import of the final version with the import of the exercise and make the test pass. Was there something that I could have clarified there? |
On exercise 8 I have a solution that passes the tests, but doesn't correctly call the state reducer with the correct arguments. My internalSetState code looks like this:
Which doesn't properly 'compute' the updates if a function is used before passing them to the stateReducer like you do in the final solution. If this isn't intended let me know and I can try to update the tests to handle this case. |
Yes, we'll want to add a test for this. I'm surprised it worked because the reset and toggle methods use both versions of the setState API 🤔 Oh, I know why it works. It just happens to work due to the simplicitic nature of the example. I'll add a test to make sure people don't make the mistake. Thanks! |
In |
Thanks @colinrcummings. As I noted in a PR that attempted to remove it:
:) |
@kentcdodds, how do you feel about the following to fix the
code:
react devtools:
code:
react devtools: In exercise 13, I believe the |
Ah yes, that makes sense. So a solution would be to change StatePrinter to: const StatePrinter = withRendux(function StatePrinter({rendux}) {
return (
<div style={{textAlign: 'left'}}>
state:
<pre data-testid="printed-state">
{JSON.stringify(rendux.state, null, 2)}
</pre>
</div>
)
}) Anyone want to do that? |
Sure thing. I'll work on a PR this weekend. |
- update exercises and tests
Hey folks! I'd love it if some of you could help me out with this workshop and make sure it's good to go! Please just follow the README instructions and let me know where you get stuck and what could be improved. Each of the exercises should be commented well enough for you to get everything done on your own without instruction.
Let me know if there are typos, legit errors, or anything that's unclear.
One thing I know is that the snapshots are failing on codesandbox. Hopefully I can get those working, but it should be working locally :) Thanks!
The text was updated successfully, but these errors were encountered: