sanyam jain

Epic React

planted 07 Mar 2022 · tended 01 Oct 2026 · 🌱 seedling

First Tutorial
React Fundamentals
  • learnt how we can have empty body and still insert Hello world inside doc

  • learnt imperative vs declarative

    • SQL - declarative - just tells what I want not "how" to get it
    • pure js - imperative, react - declarative
    • many declarative approaches have some sort of underlying abstractions
    • Programming languages - imperative: C, C++, Java - Declarative: SQL, HTM - mix: Javascript, Python
    • React helps us create declarative UI
    • declarative code is program that can be context-independent (same code can be used in different programs)
    • functional programming is a subset of declarative programming
  • react - create react elements (like document.createElement()) -> React.createElement

  • reactDOM - render react elements to DOM (like rootElement.append())-> ReactDOM.render

  • you need babel to convert JSX to React APIs

  • understood what are react elements (objects that define how it should look on screen)

  • React.createElement, first argument can be a function

  • {{}} = JSX expression + object expression

Javascript open questions
  • js declarative way
    • filter, map, reduce
  • js imperative way
    • foreach