Thursday, July 11, 2019

how to teach yourself React

https://www.youtube.com/watch?v=sBws8MSXN7A has what seems like a great training video for teaching yourself React although I honestly have only watched the first twenty-five minutes. I ran into a Juno Vue at this event and he recommended it. Some takeaways from the first twenty-five minutes:

  1. You have to use className where you would otherwise use class in HTML markup in the JSX markup.
  2. render() is a lifecycle method and the only one that is required for a component.
  3. To loop in a component in another component, for example a component called Walrus, you would import Walrus up top in the imports for the component as you would in Angular and in the JSX you would have <Walrus />
  4. Give components Pascal Case names.
  5. Have state = { } above your declaration for render() at a component, and obviously put something inside of state. Both of these things do not need to be chased by a semicolon which surprised me.
  6. Something random that came up seems to be global settings in CSS defined with an asterisk like so:
    * {
       box-sizing: border-box;
       margin: 0;
       padding: 0;
    }

No comments:

Post a Comment