This time I went to CodeNode den to see @MattLongCode @ForbesLindsay and @elektronik2k5

React to-do application with hooks - Testing

First subject was Testing React Applications that utilise new React feature hooks. My key takeaway from this talk was that testing doesn’t necessarily look really hard to write and that I can familiarize myself with that fairly quickly. Since I am a self-taught developer, I have not been yet exposed to writing tests and while Matt was showing his simple to-do list application codded on the spot, I fairly quickly understood how it’s working and how the tests are written.

Matt shared a link to his github repo. Now I have to find time and read his code thoroughly to learn something about testing especially when your app uses hooks. You can do that too. Let me know if you did and if you have questions, ask me anything.

key reminder

  • Hooks can be called from functional Components or functions only.

Explore

Powering Code Reuse with Render Props, Hooks and Context in React

I really enjoy the way Forbes talks. His talks are well structured and thought through. He speaks clearly and with perfect speed. The subject was focused on code reusing and how to achieve it through usage of Props, Hooks and Context in React. I loved the way he described functions in JavaScript using examples. How to create functions, so that we can re use and perform multiple different operations using same function. This is something I was struggling with when creating my first game in JavaScript.

I was wondering if the higher order functions and packages like recompose in React are becoming obsolete and hooks will replace them. The answer I found was: not necessarily. There is still need for higher order functions and I should familiarize myself with them along with using and deploying hooks as they allow better code reuse possibilities.

key reminder

  • React properties are like parameters to a function
  • Anything that changes is state

{ css-in-js: overflow }

This talk was very ‘opinionated’. I say it with a positive attitude and a smile on my face. Nikolai gave us insightful look into the CSS code reusability and modularity. Nick talked about how the CSS language has to catch up with modern day HTML and JavaScript and code that is mostly Componentised (Think new MVC JavaScript Frameworks). He explained css-in-js and dared us to explore it, as he believes this is a fairly good solution for implementing CSS for applications. These days we rarely develop content websites but more generally tend to develop applications. We all know that in-line CSS injection is the worst idea and that we also need to find a better way to inject CSS then doing it through selectors like tags and classes. CSS-in-JS is the way to do that by skipping the className selector (and other selectors) and at the same time not bulking up JavaScript code with CSS inside it. If you’re curious about this subject, below are links you might want to visit and read.

Explore:

Thanks for reading. As always, any questions, contact me directly => about me, use comments below to start conversation or connect through social media.