bhavyasaggi.github.io
Sitemap

React

Terms:

Single Source of Truth

Since a equality (===) check is performed by react to identify a change, it is necessary to avoid complex props, ie. only pass a non-object, non-function values like a number, string, or boolean value as props.\

Special props:

While props are received by Parent Component, a Component may maintain its own internal State. While creating states make sure to avoid structure that may cause states to contradict. Also state updates are not deep-merged. so avoiding deeply nested state is a smart choice.

React with External Systems

React started out with a client-side library to be executed on the client-side with limited support for servers. But as it matured, React now boasts features like server-actions, streaming server-components, and more.

But nonetheless there needs to be a careful consideration when communicating beyond "react-land", and limit the render-cycles.

Cross-environment Communication

There is no for Server technologies for the Web. The only way RSC (React Server Components) work is if the bundler/packager has support for them, making them a "syntactic sugar", just like async-await or classes for javascript.

Further Reading