Category Archives: Frontend

Some thoughts about reusable component design in react

Consider passing in some properties as children,  instead of props . This will make the code looks cleaner: The consumer doesn’t have to build a big “props” object to pass in You will divide a single component into several ones. Each one will a take small props object, which is highly inherent For example, instead […]

Not every kind of state needs to go to Redux

Only some kinds of state need to be in Redux, State that’s shared by multiple components on the same page State that’s read by multiple components State that’s written by one component and read by another State whose lifecycle is longer than its component. For example, “recordList” for a list page – If you go […]