Frontend setup & UI Implementation.#3
Conversation
| import React from "react"; | ||
|
|
||
| class ErrorBoundary extends React.Component { | ||
| constructor(props) { |
There was a problem hiding this comment.
Just curious, why is this ErrorBoundary alone using class component?
There was a problem hiding this comment.
Although a functional component could handle this task, I chose to implement it using a class component for simplicity and to utilize lifecycle methods like componentDidCatch and getDerivedStateFromError. While functional component solutions exist, such as those involving third-party libraries like 'react-error-boundary' or utilizing hooks like useEffect and event listeners, I find the class component approach simpler and more straightforward for error boundary management.
|
Great Work 🎉 - @hopansh |
Thanks @piyushgarg-dev 🫠🤗 |
|
@hopansh Can you please add the API and Socket Integration as well? You can use this code for reference https://github.com/piyushgarg-dev/vercel-clone/blob/8a69988450aefef68ebf8704caa6718ec666d3b4/frontend-nextjs/app/page.tsx Deployment Trigger Code vercel-clone/frontend-nextjs/app/page.tsx Lines 36 to 52 in 8a69988 Here is the video that might help you https://imgur.com/I6KgmNR Thanks :) |
Sure. 🫡 Will push the changes. |
Changes:
Known Issues and Future Scope:
|
|
Awesome @hopansh 🎉 |
There was a problem hiding this comment.
I believe we shouldn't wrap whole application in a single ErrorBoundary, instead chunks of components should be wrapped in them. @hopansh
There was a problem hiding this comment.
Thank you for your suggestion! It's indeed a valid consideration to implement error boundaries at the component level, especially when dealing with multiple components on the screen where the failure of one doesn't significantly affect the overall product value. However, in our specific scenario where only a limited number of components are present at any given time and the failure of any of them results in the failure of the entire flow or product, wrapping the entire application in a single ErrorBoundary offers a more comprehensive approach to error handling.
While implementing component-level error boundaries is a valid approach in certain scenarios, in this context, a holistic error boundary strategy at the application is more effective solution for ensuring the stability and reliability of our product in my view.
brrock
left a comment
There was a problem hiding this comment.
I don't approve I think should use ts and a turbo repo_





The frontend project uses the following dependencies:
Future Scope:
For More Info: Please refer to Readme.md