ReactJS
An introduction
by Ivan Lausuch
Why ReactJS (my oppinion)
- Create dynamic frontends (client-side rendering)
- Uses virtual DOM = Speed
- Modular: reusable code and components libraries
- Code complex apps with simplicity and elegance
- You controls the each re-rendering
- Javascript and JSX
- No needs nodeJS but could be used with it
- Could do Server-side-rendering (SSR) and hybrid (e.g. with NextJS)
Components
- A component is the building block
- It's a function (or a class for old fasion way)
- Always returns JSX code
function MyComponent(props){
return (
<h1>Hello, world!</h1>;
)
}
- Could use other componets in its code
- Gets the HTML tag attributes as properties (props)
- Should have states (a hook)
- When a state or props value change will re-render the component
- Could have other hooks and you can create others
Let's play
ReactJS An introduction by Ivan Lausuch
{"metaMigratedAt":"2023-06-15T18:43:55.332Z","metaMigratedFrom":"YAML","title":"ReactJS","breaks":true,"slideOptions":"{\"theme\":\"white\"}","contributors":"[{\"id\":\"0de751ad-95d4-4fdd-bf2a-c796404864ea\",\"add\":1291,\"del\":112}]"}