DEV Community

Discussion on: Making Sense of React Hooks

Collapse
 
xni profile image
Konstantin • Edited

Hi, Dan! Thank you for all you and the team are doing for the community!

If you have a couple of spare moments, I had a couple of ideas, maybe you can find then anyhow interesting.

1) You are saying that functions are stateless but in ES6 we have a function* or async function. They can be used as the event generators I suppose. Something like

const eventGenerator = ...;
while (true) {
   await eventGenerator();
   render();
   eventGenerator = ...;
}

Have you considered that option?

2) Just a fun thing: Logo of the city where I was born is an atom - why not to do the next React conf there? ;)

3) This is the example from the React Documentation

useEffect(() => {
    // Update the document title using the browser API
    document.title = `You clicked ${count} times`;
  });

I think it is pretty confusing, there is no reason why this particular example cannot be rewritten as

document.title = `You clicked ${count} times`;
Collapse
 
xni profile image
Konstantin

UPD. Actually found the answer to my third question in the React API Reference.