In this repository, I've implemented (or implementing) all the concepts related to React and its related technologies (like Redux, Context API & GraphQL). Please feel free to go through this repository for your own learning/revision as I'll be doing the same if I ever need to revise/reinforce my knowledge on React (or it's related technologies).
- ReactJS Docs
- MOOC by Andrei Neagoie & Yihua Zhang
- MOOC by Academind, taught by Maximilian SchwarzmΓΌller
- Monsters Rolodex: GitHub Repo & Live Deployment
- Build My Burger: GitHub Repo & Live Deployment
- How to use
create-react-app
to initialize a react project: Tutorial here | Files that are added after first init - First Change in the React App: Changes Made
- Class Components, Initializing State in
constructor()
& UsingsetState()
on an HTML Element in JSX: Changes Made - Rendering a list of items in react using
key
prop: Changes Made props
,props.children
, functional components, making new components & usage ofcomponentDidMount()
life-cycle method: Changes Made- Sending state from one component to another, component nesting & reason why we use components: Changes Made
- Handling DOM Events in JSX, Getting Data from User Input &
setState()
's asynchronous behaviour: Changes Made - Dynamic rendering of components due to
setState()
andrender()
methods: Changes Made - Difference between
.js
and.jsx
files, functional v. class components & destructuring props object as a parameter in a functional component: Changes Made - Writing our own methods inside the App component & why are life-cycle defined normally like a function and not as an arrow function: Changes Made
- Deploying a static app on GitHub Pages & Finishing Touches: Deploying Static Websites to GitHub Pages, Changes Made & Monsters Rolodex App Live Here
- What does
create-react-app
command actually does? An in-depth understanding ofReact
&ReactDOM
: Commit Changes Here & Basic File Structure for React Apps - Wrapping all the basics in one example β
props
,props.children
,setState()
,state
,React.Component
,event-handling
, etc: Commit Changes - Using the
useState()
Hook for State Manipulation: Commit Changes - Passing Method References b/w Components: Commit Changes
- Adding Two Way Binding: Commit Details
- Styling Components - Inline Styling using JSX & Importing External Style Scripts: Commit Details
- Overall wrap-up of all the basics: Assignment Solution in Javascript & Assignment Solution in Typescript
- Rendering Content Conditionally
- Using the ternary operator: Commit Details
- Using control flow
if-else
[recommended way]: Commit Details
- Outputting Components in a List using
map()
: Commit Details - Affecting
state
from a generated List of Components- Updating State Directly (flawed approach, can lead to unknown behaviour of the apps): Commit Details
- Updating State Immutably (correction to the flawed approach) using
splice()
or...
[Spread Operator]: Commit Details
- Lists & Keys
- Usage of
key
prop: Commit Details - Making Lists Flexible w.
<input>
element inside the component: Commit Details
- Usage of
- Section wrap-up & Assignment: My Solution in JavaScript, Instructor's Solution in Javascript & My Solution in TypeScript (Use App)
- Setting Styles Dynamically: Commit Details
- Setting Class Names Dynamically: Commit Details
- Adding & Using Radium β
npm i --save radium
- Implementing pseudo-classes like
:hover
: Commit Details - Implementing Media Queries
@media
using{StyleRoot} from 'radium'
: Commit Details
- Implementing pseudo-classes like
- Adding & Using Styled Component β
npm i --save styled-components
π- Styling components using Tagged Templates with
styled-components
library: Commit Details - How
styled-components
library generates the CSS required for the respective component: Commit Details - Dynamic styling with
props
inside a tagged template string: Commit Details & Do the same in TypeScript
- Styling components using Tagged Templates with
- Working with CSS Modules
- Why do we need CSS Modules? Commit Details
- Using CSS Modules: SETTINGS_README.md & Commit Details
- Media Queries using CSS Modules: Commit Details
- Using
ErrorBoundaries
if an Error occurs in the react app, usingcomponentDidCatch(err, info)
method: Commit Details π«β
- A Better Project Directory Structure: Commit Details
- Splitting an App into Components for cleaner structure/readability: Commit Details
- Sending
props
to<App/>
component: Commit Details - Component Creation Lifecycle in Action: Commit Details
- Component Update Lifecycle
- When
props
change: Commit Details - When
state
changes: Commit Details
- When
useEffect()
and its uses- Usage inside a functional component: Commit Details
- Controlling the Behaviour of
useEffect()
: Commit Details
- Lifecycle Methods for Cleanup Work in class-based components using
componentWillUnmount()
& in functional components usinguseEffect()
: Commit Details - Optimization in React
- Using Lifecycle Method -
shouldComponentUpdate()
: Commit Details - Using
React.memo()
for optimizing functional components: Commit Details - Checking all the
props
info usingshouldComponentUpdate
: Commit Details - Extending
PureComponent
instead of definingshouldComponentUpdate()
to check all theprops
manually: Commit Details
- Using Lifecycle Method -
- Rendering Adjacent JSX Elements
- Using JS Arrays/Lists: Commit Details
- Using a HOC (like say,
<Auxiliary />
component): Commit Details - Using a built-in HOC for wrapping/rendering JSX elements β
<React.Fragment>
: Commit Details
- Higher Order Components (HOC)
- Introduction to HOC: Commit Details
- Another form of HOC using Closure: Commit Details
- Passing Unknown
props
to HOC's using Closure: Commit Details
- Setting State Correctly using
setState((prevState, props) => ({...prevState, }));
: Commit Details - Using
PropTypes
βnpm i --save prop-types
: Commit Details Refs
in React- Why Refs? Introduction & Usage of
Refs
in class-based components (before React v16.3): Commit Details - Usage of
Refs
in class-based components (after React v16.3) usingReact.createRef()
: Commit Details Refs
in functional components usinguseRef()
hook: Commit Details
- Why Refs? Introduction & Usage of
- Context API in React
- Problems with
prop
chaining β Why use the concept of Context? Commit Details - Using the Context API using
React.createContext()
: Commit Details - Alternative way of using Context API in class-based components using
contextType
& Using functional components in functional components usinguseContext()
hook: Commit Details
- Problems with
Required Dependency: npm i --save axios
| axios
DOCS | API Endpoints: /posts, /posts/user_id
- Creating an HTTP Request to GET Data using
axios.get(url)
method: Commit Details - Rendering Fetched Data to the View: Commit Details
- Transforming the Fetched Data to Limit the Components on the View: Commit Details
- Making a Post Selectable: Commit Details
- Fetching Data on Update (w/o Creating Infinite Loops) in
componentDidUpdate()
lifecycle method: Commit Details - POSTing Data to the Server using
axios.post(url, data, dataConfig)
method: Commit Details - Sending a DELETE Request using
axios.delete(url)
method: Commit Details - Handling Errors Locally using
.catch(err)
method: Commit Details - Adding Interceptors using
axios.interceptors
to Execute Code Globally: Commit Details - Setting a Default Global Configuration for Axios using
axios.defaults
: Commit Details - Creating and Using Axios Instance using
axios.create()
method: Commit Details
- Setting Up Route Links in
<Blog />
Component: Commit Details - Setting Up The Router Package
npm i --save react-router react-router-dom
: Commit Details - Preparing the Project for Routing β Making
<NewPost />
,<FullPost />
&<Posts />
Components as a Container for Proper Routing: Commit Details - Setting Up and Rendering Routes using
path
,exact
&render
attributes inside the<Route />
Component: Commit Details - Rendering Components for Routes using
render
andcomponent
prop inside the<Route />
Component: Commit Details - Switching between Pages using Links
- Inefficient Way to Re-route β Entire Page Reloads using
<a href="/">Home</a>
Component: Commit Details - Efficient Way to Re-route β The Page Doesn't Reload using
<Link to="/">Home</Link>
Component: Commit Details
- Inefficient Way to Re-route β Entire Page Reloads using
- Using the Props (Routing Info) Sent to the Components Rendered from the
<Route />
Component: Commit Details - The
withRouter()
HOC & Route Props: Commit Details - Absolute vs. Relative Paths: Commit Details
- Styling the Active Route using
<NavLink to="<route>" exact activeClassName="<class-name>" activeStyle={<style-object>}/>
Component: Commit Details - Detecting Dynamic Routes using
<Route to="/:id" />
& Passing Route Parameters: Commit Details - Extracting Route Parameters using
this.props.match.params
: Commit Details - Using Unique Route Names to Load a Single Route: Commit Details
- Using
<Switch />
to Load a Single Route at a time: Commit Details - Navigating to Specified Routes Programmatically, using
this.props.history.push()
method, instead of using the<Link />
Component: Commit Details - Understanding Nested Routes
- Introduction & Usage: Commit Details
- Naming Routes Logically & Relative URLs in Nested Routes using
this.props.match.url
: Commit Details - Creating Dynamic Nested Routes by Defining Proper Lifecycle Methods: Commit Details
- Redirecting Requests
- Redirecting using the
<Route />
Component (Not Recommended): Commit Details - Redirecting using the
<Redirect from="<route-name>" to="<route-name>" />
Component inside a<Switch />
Component (Recommended): Commit Details - Conditional Redirects using
<Redirect to="<route-name>"/>
Component: Commit Details - Using
this.props.history.push()/replace()
to Redirect: Commit Details - Working with Navigation Guards: Commit Details
- Handling the 404 Not Found Case using
path
less<Route />
: Commit Details - Lazy Loading / Code Splitting π΄ β π₯Importantπ₯
- Loading Routes Lazily Using Asynchronous Dynamic
import()
method inside our own custom-made HOC: Commit Details - Lazy Loading Components Asynchronously with
React.lazy()
method &<React.Suspense fallback={<div>Loading...</div>} />
Component: Commit Details - Resolving Errors in
<NewPost />
Due to Lazy Loading β Wrapping<NewPost />
withwithRouter()
HOC: Commit Details
- Loading Routes Lazily Using Asynchronous Dynamic
- Setting a
basename
prop for the<BrowserRouter />
Component for Proper Routing & Server Deployment: Commit Details
- Redirecting using the
- Assignment Solution: My Solution @CodeSandBox, Instructor's Solution @CodeSandBox β v1
Dependency Installations: npm i --save redux
| npm i --save react-redux
- Understanding the Redux Flow π: Read @CodeSandBox | Image - Direct Link
- State Management With Redux Using Pure JS on Node Runtime β
node <file-name>.js
- Setting Up
Reducer
&Store
: Commit Details - Dispatching
Actions
& Adding Logic forActions
inReducer
: Commit Details - Adding
Subscriptions
: Commit Details
- Setting Up
- Integrating Redux into React βπβ»
- Setting Up Redux Before Connecting to React: Commit Details
- Connecting Redux
STORE
to React using<Provider />
Component: Commit Details - Dispatching
ACTIONs
from within a React Component: Commit Details | Assignment Solution @CodeSandBox | Commit Details for Assignment
- Handling Redux
STORE
- Updating State Immutably: Commit Details
- Updating Arrays in the State Immutably: Commit Details
- Outsourcing
ACTION
Types: Commit Details - Combining Multiple
REDUCERS
: Commit Details - Redux Basics Assignment: Solution @CodeSandBox & Commit Details
- Combining Local UI
state
& ReduxSTORE
: Commit Details
- What is
MIDDLEWARE
&& AddingMiddleware
In Practice usingapplyMiddleware()
function: Read @CodeSandBox & Commit Details - Using the Redux DevTools: Setting Up Redux STORE for Redux DevTools & Commit Details
- Introduction & Usage of
ACTION Creators
: Commit Details - Handling Asynchronous Code using
redux-thunk
βnpm i --save redux-thunk
: Commit Details - Restructuring
ACTIONS
: Commit Details - Where to Put Data Transforming Logic? Commit Details
- Using
ACTION Creators
&getState()
: Commit Details - Using Utility Functions
- Inside the
Counter REDUCER
: Commit Details - Inside the
Results REDUCER
: Commit Details
- Inside the
- A Leaner Switch Case Statement: Commit Details
- How Webpack Works: Commit Details
- Basic Webpack Workflow Requirements: Commit Details
- Webpack Project Setup using
npm
βnpm i --save-dev webpack webpack-dev-server
: Commit Details