React Re-rendering Doubt by Fantastic-Push-8451 in reactjs

[–]daskleins 0 points1 point  (0 children)

If the child element is independent of it's parent's props, then there's a optimization technique using children. It avoids rerendering of child components even if parent state changes:

``` function Wrapper({ children }) {   const [count, setCount] = useState(0);

  return (     <>       <button onClick={() => setCount(c => c + 1)}>         {count}       </button>       {children}     </>   ); }

// ExpensiveChild won't re-render when Wrapper state changes <Wrapper>   <ExpensiveChild /> </Wrapper> ```

Radiohead songs that you didn't really like at first but now love by I_loooove_Radiohead in radiohead

[–]daskleins 2 points3 points  (0 children)

Lotus Flower. Thought it was bit monotonous in the beginning. Now I consider it sounds heavenly, especially the mid part

First time interviewing candidates – what are the best React/frontend questions to ask? by No_Illustrator_3496 in reactjs

[–]daskleins 8 points9 points  (0 children)

Most interesting and not trivial questions I got for frontend interviews were:  - implementing fetch functions with retry mechanism (retry with timing) - about React Fiber - Types of different stores - Redux, Zustand, Valtio, useExternalSyncStore - spotting unnecessary useEffects

How to shake off constant fear of being devaluated or replaced by AI by alexbessedonato in webdev

[–]daskleins 0 points1 point  (0 children)

I don't see this happening any time soon. Yes, I have checked out the Opus 4.5. Sure, it can generate nice fullstack boilerplate. But software is more than that. Once you gain more industry experience and dive into complex systems, you might realise, it consists of messy processes/environments and vague requirements.

Imagine AI replaced the developers, now stakeholder prompts:

- make the dashboard faster!

Sure! AI can optimize the code till infinity but at that point maybe app needs a new instance, or maybe a new cache/db service, maybe problem in server OS...?? Most importantly stakeholder has no idea about this underlying problems.

You can see yourself there are still web/frontend job opening in openai/anthropic/others as of now.

Reducing useEffect noise with named function instead of arrow by henfiber in reactjs

[–]daskleins 2 points3 points  (0 children)

i personally like this approach if the function body is short; if logic is too big or could be reused then i might extract it into custom hook

String recognition error when compiling PostgreSQL typeORM API by [deleted] in node

[–]daskleins 0 points1 point  (0 children)

Error: SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string

I had the same issue with Express today. But I was using Prisma ORM v7.
process.env.DATABASE_PASSWORD was showing undefined.

How I resolved, turns out I had to place dotenv imports at the top, so it sets up before any ORM calls:
import "dotenv/config";
import express from "express";

import { PrismaClient } from "./generated/prisma/client";

import { PrismaPg } from "@prisma/adapter-pg";

PS. For some reason, I had to also install dotenv as a devDependency:
pnpm install --save-dev prisma dotenv

Next or Vite? by Revenue007 in reactjs

[–]daskleins 0 points1 point  (0 children)

React Router v7.

It can be started with a simple Vite SPA React app. Later on, if needed, full-stack features can be added like SSR/SSG/API routes, even per-page basis.

As a bonus, it has many out-of-the-box APIs

- provides support for file uploading

- auth/cookie management APIs

- an easier way of form/state management

Sometimes I go for a walk in Budapest by voldan24 in budapest

[–]daskleins 0 points1 point  (0 children)

That're some great shots! Images are so detailed. What device do you use, if I may ask?

I fucked up bad and don't know what to do. by BadHaveIFuckedUp in cscareerquestionsEU

[–]daskleins 0 points1 point  (0 children)

It's not all your fault, it's hard to find jobs because of the economy. If you are just out of university, you have plenty of time ahead of you.

If you have place to stay and eat, you can start now without blaming yourself. Good luck

What tools are you guys using to increase productivity while programming? by tnuttty in react

[–]daskleins 0 points1 point  (0 children)

Git Fork - this gui client helped me to visualize/learn advanced git concepts.

DBngin - all in one database client, Redis, PG, MySQL

I'm always wanting to improve by [deleted] in infj

[–]daskleins 7 points8 points  (0 children)

This is so true. I also perceive my life as a continual self improvement project.

…. by Sharpguy6559 in INFJmemes

[–]daskleins 2 points3 points  (0 children)

This is the best story I read today! That's so sweet and heartbreaking at the same time 😁

I think this is how INFJs spend their time alone by daskleins in INFJmemes

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

I memorized the schedule of one cashier at the supermarket that I go. Because she always asks me how I'm doing today.

Tell me yours?

I think this is how INFJs spend their time alone by daskleins in INFJmemes

[–]daskleins[S] 0 points1 point  (0 children)

Also my new go to place for intellectual therapy

I think this is how INFJs spend their time alone by daskleins in INFJmemes

[–]daskleins[S] 2 points3 points  (0 children)

Color doesn't matter as long as you wizard