Tiny React Apps
Essay
This is a collection of tiny apps built with React, designed to explore and learn React along with its associated libraries. Each project serves as a hands-on …
Essay
This is a collection of tiny apps built with React, designed to explore and learn React along with its associated libraries. Each project serves as a hands-on …
Essay
I hope you know what is useMemo and understood that it caches the values between re-renders. `useCallback` is similar to this and it caches a function instead …
Essay
An online handbook about React that will cover all the basic topics. Unlike a physical handbook, this online book will evolve over time as I continue to learn …
Essay
React ensures your user interface stays in sync with the application state by using a technique called re-rendering. During re-renders, React compares the …
Essay
Redux is a JavaScript library that can be used with various JavaScript frameworks, including React, Angular, Vue, and Vanilla JS. It serves as a state …
Note
Below are the different types of states that can exist within an application. There are three main types:
Local state pertains to a single component. An example of this would be listening to user input in a field or toggling a “show more details” button. Typically, local state is managed within the component using useState or useReducer.
Cross-component state impacts multiple components. For instance, managing the open/closed state of a modal overlay. While this can also be managed using useState or useReducer, it often involves passing state between components via props drilling.
App-wide state influences the entire application, such as themes or user authentication status. Similar to cross-component state, this can be managed using useState or useReducer, albeit with the assistance of props drilling.
Essay
A React Single Page Application (SPA) is essentially a static website and can be easily hosted using platforms like Firebase or Netlify. Here I am explaining …
Note
The LISTAGG analytic function, introduced in Oracle 11g Release 2, greatly simplifies string aggregations within SQL queries.
SELECT pid, LISTAGG(ColumnName, ' ' ) WITHIN GROUP (ORDER BY seq) AS ColumnName
FROM B GROUP BY pid;However, if the output of the above query exceeds 4000 characters, it triggers an error, specifically ORA-01489, indicating that the result of string concatenation is too long.
To address this limitation, Oracle Database Release 2 (12.2) enhanced LISTAGG with the ability to handle overflow errors gracefully, as demonstrated below:
SELECT pid, LISTAGG(ColumnName, ' ' ON OVERFLOW TRUNCATE ) WITHIN GROUP (ORDER BY seq) AS ColumnName
FROM B GROUP BY pid;In this updated syntax, the output is restricted to 4000 characters, preventing the ORA-01489 error from being raised.
The ON OVERFLOW clause offers several options to manage overflow situations:
ON OVERFLOW ERROR: This is the default behavior, triggering an error if the result overflows.ON OVERFLOW TRUNCATE 'StringYouLike': Appends ‘StringYouLike(Count)’ at the end of the truncated string.ON OVERFLOW TRUNCATE '': Displays the first 4000 characters without any additional terminating string.ON OVERFLOW TRUNCATE WITH COUNT: Appends the total character count at the end, for example, ‘…(5512)’.Essay
In React there are several built-in Hooks like `useState`, `useEffect`, and `useContext`. Sometime you need to create your own Hooks for specific purpose like …
Essay
Traditionally, you pass information from a parent component to child component via props in React. But data passing through this props drilling can make your …