2022-07-01から1ヶ月間の記事一覧

React: Note on what happens during rendering and re-rendering

this is a note on what goes on when a component renders and re-renders notes are from watching React Render Tutorial - YouTube Rendering has 2 phases: Initial Render: Render phase: -start at root -goes down leaf components -use createEleme…

React: Simple context template

import React, { createContext, Dispatch, useContext, useReducer } from "react" const hogeData = {}; export const HogeContext = createContext<any>(hogeData) export const HogeDispatchContext = createContext<Dispatch<any>>(() => { }) export const HogeContextPro</dispatch<any></any>…

Regex: match one byte character and number

event.target.value.match(/^[A-Za-z0-9]+$/)