Sobes.tech

If the ProfilePage component re-rendered with two dependencies and roles were not passed, will useEffect trigger?

275

When does JavaScript execution occur during HTML parsing?

275

If useEffect has two dependencies, what happens when one of them changes?

266

If roles is undefined and the component re-renders, what happens to useEffect?

254

What is the difference between useMemo and React.memo? Is it possible to prevent a component wrapped in React.memo from re-rendering even if props change?

224

If the ref was filled for a non-admin user, and then they became an admin — what problem arises with the logic inside the hook?

222

If it was undefined and after rerender it is undefined again — has the dependency changed?

216

In which scenarios do you use useEffect, and when do you use other hooks?

202

You have a main application on Vite, and separately Next.js — have you had to delve into the build process? What tools are Vite and Next.js built upon?

200

The component uses a context with user and roles. If the component only uses user from the context, it will still re-render when roles change. How to fix this?

200

If the user is not an admin, useRef and useContentSizeUpdater hooks are still called. How to solve this problem without changing the useContentSizeUpdater hook itself?

198

An array is an object. How are objects passed in JavaScript — by value or by reference?

193

What will happen in the second block with the asynchronous loadRolesData function inside useEffect?

193

How are things with TypeScript? Have you used generics, utility types, TypeGuard?

192

What to do so that when the default value roles = [] is used, the array is not recreated on every render?

191

How to fix the default value roles = [] issue so that useEffect is not called repeatedly on re-render?

191

How is your architecture organized according to Feature-Sliced Design (FSD)? How is the business logic distributed across layers?

186

Do you have an internal NPM repository? Do you use tools for monorepos, like Lerna?

184

If the roles array is empty, what will happen to useEffect?

178

/* File ProfilePage.tsx This file needs to be fixed for errors */

178
/3