Skip to content

Instantly share code, notes, and snippets.

View dijs's full-sized avatar
🏠
Working from home

Richard van der Dys dijs

🏠
Working from home
View GitHub Profile
@dijs
dijs / destructing-lesson.md
Created October 26, 2015 17:58
Don't destruct stateful methods

Here is my simple example:

class Speaker {
  constructor(name) {
   this.name = name 
  }  
  say(msg) {
    console.log(`${this.name}: ${msg}`)
 }
@dijs
dijs / one-line-jsx.md
Created October 26, 2015 13:37
What is One Line JSX?

JSX can get messy fast.

I was recently introduced to writing smart and dumb components when using react. As an extension to keeping the presentation code strictly within dumb components, I try to write one line JSX.

Original JSX (NOT ONE LINE JSX):

class SomeListComponent {
  render() {
 let names = this.props.names.map(({first, last}) => {