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:
- You have to use className where you would otherwise use class in HTML markup in the JSX markup.
- render() is a lifecycle method and the only one that is required for a component.
- 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 />
- Give components Pascal Case names.
- 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.
- 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