Live data from Hacker News

Build Your Own React

pomb.us

111–114 of 114 posts

Re: Build Your Own React

#112
post #5

Very, very nice. His presentation library is available as well! https://codesurfer.pomb.us/ https://github.com/pomber/code-surfer/blob/code-surfer-v2/re...

Please don't perpetuate this type of animated presentation style. Why? 1) Vertical layout is easier to scroll 2) Vertical layout puts the code blocks in-line to know where they belong in the text 3) Author's presentation style has animations that slow down user's ability to scan quickly 4) Scroll position determines the code block's visibility (!!! WTF) 5) Either have the entire page white or black. The contrast chan…

documentation =/= presentation

Re: Build Your Own React

#113
post #5

Very, very nice. His presentation library is available as well! https://codesurfer.pomb.us/ https://github.com/pomber/code-surfer/blob/code-surfer-v2/re...

Please don't perpetuate this type of animated presentation style. Why? 1) Vertical layout is easier to scroll 2) Vertical layout puts the code blocks in-line to know where they belong in the text 3) Author's presentation style has animations that slow down user's ability to scan quickly 4) Scroll position determines the code block's visibility (!!! WTF) 5) Either have the entire page white or black. The contrast chan…

I do agree with you. I found it amazing to look at, but not very usable if you just wanna look at the code.

Re: Build Your Own React

#114
post #51

Earlier quoted context omitted.

It's not really bananas when you actually start to think of everything 'as components', and consider that 'render' can neatly, declaratively describe behaviour, not just the DOM.

That _is_ how I think about components, but it's still bananas. Render does not neatly describe this behavior because it necessitates setting unnecessary state. That's gross. Usually when I need to trigger a redirect, I'm in some business-level function. So to redirect this way, I would need to set some state in my store, re-render, then hit the conditional, which would redirect, probably unset that state, and then p…

Then you can use `useHistory` (or `withRouter` if you're not hooks-ready).

I somewhat agree that the component is not actually that useful, it's only useful in very simple cases like "based on one route plus conditional redirect to another", e.g.:

    
      {usersPreviousShoppingGender === "women" ? (
        
      ) : (
        ...
      )}
      ...
    
    
Post reply on HN