Skip to main content

Posts

Featured

Designing React States

  Why We Need to Design States We already know that we should use state if we want the component to change the content it is rendering. What we don't have answers for yet is: when should state be called? what type of data should the state be? in which component is it defined? This design process will pay off when trying to answer these questions in complicated projects so practice it with simple projects first.  It follows three main steps: distinguish states from events, distinguish the variable name and data type for the state, distinguish which component should house this state according to the other components that will need it as props  State Design Process Distinguishing State from Event First, we have to figure out what will be a state and what will be an event handler given the three following questions: 1. make a list of actions your user can make and the changes in the UI said actions make  2. generally speaking, user actions are event handlers and the chan...

Latest Posts

Designing Custom Hooks in React

i3 Config for Development

Typescript Express Setup

Setup Dev Environment for TS

PostgreSQL Basics

Setting up venv for new python project

Hosted vs Self-Hosting Platforms