hello.js

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

Tuesday, 26 March, 2019 UTC

Name It, and They Will Come

Name It, and They Will Come

You’ve discovered something new. You haven’t seen solutions quite like this before. You try to keep your ego in check and be skeptical. But the butterflies in your stomach won’t listen. You don’t want to get carried away, but deep down you already know ... more


Saturday, 16 March, 2019 UTC

Writing Resilient Components

Writing Resilient Components

When people start learning React, they often ask for a style guide. While it’s a good idea to have some consistent rules applied across a project, a lot of them are arbitrary — and so React doesn’t have a strong opinion about them. You can use different ... more


Saturday, 9 March, 2019 UTC

A Complete Guide to useEffect

A Complete Guide to useEffect

You wrote a few components with Hooks. Maybe even a small app. You’re mostly satisfied. You’re comfortable with the API and picked up a few tricks along the way. You even made some custom Hooks to extract repetitive logic (300 lines gone!) and showed ... more


Sunday, 3 March, 2019 UTC

How Are Function Components Different from Classes?

How Are Function Components Different from Classes?

How do React function components differ from React classes? For a while, the canonical answer has been that classes provide access to more features (like state). With Hooks, that’s not true anymore. Maybe you’ve heard one of them is better for performance. ... more


Monday, 4 February, 2019 UTC

React as a UI Runtime

React as a UI Runtime

Most tutorials introduce React as a UI library. This makes sense because React is a UI library. That’s literally what the tagline says! I’ve written about the challenges of creating user interfaces before. But this post talks about React in a different ... more


Monday, 4 February, 2019 UTC

Making setInterval Declarative with React Hooks

Making setInterval Declarative with React Hooks

If you played with React Hooks for more than a few hours, you probably ran into an intriguing problem: using setInterval just doesn’t work as you’d expect. In the words of Ryan Florence: I’ve had a lot of people point to setInterval with hooks as some ... more


Friday, 25 January, 2019 UTC

The “Bug-O” Notation

The “Bug-O” Notation

When you write performance-sensitive code, it’s a good idea to keep in mind its algorithmic complexity. It is often expressed with the Big-O notation. Big-O is a measure of how much slower the code will get as you throw more data at it . For example, ... more


Tuesday, 15 January, 2019 UTC

2018年,那些我所不知道的技術

2018年,那些我所不知道的技術

大家常以為我懂很多技術。事實上,人們假設的遠比我真正懂的還要多出許多。這並非壞事,我也不是在抱怨。(少數族群的朋友們,儘管他們擁有努力得來的證書,則常受到相反的偏見。) 在這篇文章裡,我會列出一些大家以為我會,但我其實不會的程式設計相關的技術 。我並不是說 你 不需要去學習它們 — 或是 其他 有用但我所不知道的東西。但既然我現在並非身處弱勢,我可以誠實地談論這個議題。 為什麼我覺得這很重要? 首先,很多人對於有經驗的工程師常有一個不切實際的迷思,認為他們一定知道自己領域內的所有技術。你有看過那種列出一大堆函式庫和工具的「學習路線圖」嗎?它們很有用,但也令人望而生畏。 ... more


Tuesday, 15 January, 2019 UTC

Neden super(props) yazıyoruz?

Neden super(props) yazıyoruz?

Duyduğuma göre Hooks en çok konuşulan yenilik olmuş. İronik olarak, bu bloğu class bileşenleri hakkında bilinmeyen gerçekleri açıklamak için açmak istedim. Burda anlatılanlar, React’ı üretken olarak kullanmak için çok da önemli değil . Ancak bir şeylerin ... more


Sunday, 30 December, 2018 UTC

The Elements of UI Engineering

The Elements of UI Engineering

In my previous post, I talked about admitting our knowledge gaps. You might conclude that I suggest settling for mediocrity. I don’t! This is a broad field. I strongly believe that you can “begin anywhere” and don’t need to learn technologies in any ... more


Friday, 28 December, 2018 UTC

Things I Don’t Know as of 2018

Things I Don’t Know as of 2018

People often assume that I know far more than I actually do. That’s not a bad problem to have and I’m not complaining. (Folks from minority groups often suffer the opposite bias despite their hard-earned credentials, and that sucks .) In this post I’ll ... more


Thursday, 13 December, 2018 UTC

Why Do React Hooks Rely on Call Order?

Why Do React Hooks Rely on Call Order?

At React Conf 2018, the React team presented the Hooks proposal. If you’d like to understand what Hooks are and what problems they solve, check out our talks introducing them and my follow-up article addressing common misconceptions. Chances are you ... more


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