day 242 — code 365

Fri 12 Aug 2016

Git

Realising that when reviewing PRs to park / commit the work I’ve been doing on the current branch, and then actually PULL the PR branch. This allows you to not only view the code, but also the UI in the browser. This is especially good to see how the markup and styles are compiled, and to see if the user flow / experience works as intended, which is not possible by merely viewing code on GitHub.

Enzyme

mount is for nested components:

<Fieldset>
<FieldsetLeft fieldName="Heading" />
<FieldsetRight />
</Fieldset>

To look for a class name inside of FieldsetLeft, we need to use mount.

Using shallow will yield a 0.

React

Am loving the composable nature of React — writing another component today was quite easy because it used 2 other functional components that rendered based on a few simple props handed down to them.

I can see the importance of writing good reusable components! But, also, how there is a limit to how extensible / reusable something is — there’s no point trying to write a super general component either!