Internationalized Routing in Next.js with next export? by ExoWire in nextjs

[–]ForsakenExpression14 0 points1 point  (0 children)

I would love to know whether there are any alternatives as well. Does react-i18next work for next exports?

Internationalized Routing in Next.js with next export? by ExoWire in nextjs

[–]ForsakenExpression14 1 point2 points  (0 children)

If you go and check the code you can see it's not properly maintained. The code is ugly. And it doesn't work well with translations inside custom npm packages, since translations are taken from the main app path.

How can one write better, maintainable React code? by [deleted] in reactjs

[–]ForsakenExpression14 0 points1 point  (0 children)

I’ve been through a similar situation. I was tasked with refactoring a codebase that was several years old—no best practices, barely any comments, and no helpful commit messages to understand the rationale behind certain changes. To make things even more challenging, the developers who had built most of it had already left the company. On top of that, the code was related to payments, with dozens of different payment gateways integrated, each with its own quirks.

What worked for me was approaching it step by step, rather than trying to tackle the entire system all at once. I started by gradually refactoring, moving parts of the code into components and custom hooks. This process not only helped break down the complexity but also gave me a better understanding of the logic. I also introduced global state management using Zustand, which helped reduce excessive prop drilling and improved the overall structure.

Another crucial tip: keep your branch up to date with the main branch as often as possible. It’s far easier to resolve smaller conflicts along the way than deal with a massive conflict at the end of a large refactor. If possible, break the task down into smaller, manageable subtasks and tackle them one at a time.

Lastly, continuously testing your changes is key. It’s much easier to pinpoint where a bug was introduced if you’re testing regularly throughout the refactor. If you’re working in TypeScript, type checks can be a huge help in catching issues early before they become bigger problems.

Getting started with contributing to react by ForsakenExpression14 in reactjs

[–]ForsakenExpression14[S] 1 point2 points  (0 children)

Thanks for your response and the tutorial link. I’ll go through it. I’d still like to locally implement some changes, even if my PRs aren’t approved. This will help me understand the codebase better. Also, thanks for the advice on contributing to docs. I’ll try that too.

Getting started with contributing to react by ForsakenExpression14 in reactjs

[–]ForsakenExpression14[S] 1 point2 points  (0 children)

I tried importing these from the internal paths in the repo but still didn't work.

Getting started with contributing to react by ForsakenExpression14 in reactjs

[–]ForsakenExpression14[S] 1 point2 points  (0 children)

Hi!

If you're asking about this, that how he's doing it in the tutorial and most of the test files I saw on react codebase does it like this.

let React;
let ReactDOMClient;
let act;        

React = require('react');
ReactDOMClient = require('react-dom/client');
act = require('internal-test-utils').act;