hello.js

var please = require('share');
console.log('thank you');

Sunday, 9 December, 2018 UTC

How Does setState Know What to Do?

How Does setState Know What to Do?

When you call setState in a component, what do you think happens? import React from 'react'; import ReactDOM from 'react-dom'; class Button extends React.Component { constructor(props) { super(props); this.state = { clicked: false }; this.handleClick ... more


Saturday, 8 December, 2018 UTC

My Wishlist for Hot Reloading

My Wishlist for Hot Reloading

Do you have a project that you approach repeatedly with a mix of success and failure, step aside for a while, and then try again — year after year? For some, it might be a router or a virtual list scroller. For me, it’s hot reloading. My first exposure ... more


Tuesday, 4 December, 2018 UTC

Why Do React Elements Have a $$typeof Property?

Why Do React Elements Have a $$typeof Property?

You might think you’re writing JSX: <marquee bgcolor="#ffa7c4">hi</marquee> But really, you’re calling a function: React.createElement( /* type */ 'marquee', /* props */ { bgcolor: '#ffa7c4' }, /* children */ 'hi' ) And that function ... more


Monday, 3 December, 2018 UTC

Why Do React Elements Have a $$typeof Property?

Why Do React Elements Have a $$typeof Property?

You might think you’re writing JSX: <marquee bgcolor="#ffa7c4">hi</marquee> But really, you’re calling a function: React.createElement( /* type */ 'marquee', /* props */ { bgcolor: '#ffa7c4' }, /* children */ 'hi' ) And that function ... more


Sunday, 2 December, 2018 UTC

How Does React Tell a Class from a Function?

How Does React Tell a Class from a Function?

Consider this Greeting component which is defined as a function: function Greeting() { return <p>Hello</p>; } React also supports defining it as a class: class Greeting extends React.Component { render() { return <p>Hello</p>; ... more


Sunday, 2 December, 2018 UTC

How Does React Tell a Class from a Function?

How Does React Tell a Class from a Function?

Consider this Greeting component which is defined as a function: function Greeting() { return <p>Hello</p>; } React also supports defining it as a class: class Greeting extends React.Component { render() { return <p>Hello</p>; ... more


Friday, 30 November, 2018 UTC

Why Do We Write super(props)?

Why Do We Write super(props)?

I heard Hooks are the new hotness. Ironically, I want to start this blog by describing fun facts about class components. How about that! These gotchas are not important for using React productively. But you might find them amusing if you like to dig ... more


Friday, 30 November, 2018 UTC

Why Do We Write super(props)?

Why Do We Write super(props)?

I heard Hooks are the new hotness. Ironically, I want to start this blog by describing fun facts about class components. How about that! These gotchas are not important for using React productively. But you might find them amusing if you like to dig ... more