Logo

    Is using md5 as key an anti-pattern in react?

    enNovember 10, 2022
    What was the main topic of the podcast episode?
    Summarise the key points discussed in the episode?
    Were there any notable quotes or insights from the speakers?
    Which popular books were mentioned in this episode?
    Were there any points particularly controversial or thought-provoking discussed in the episode?
    Were any current events or trending topics addressed in the episode?

    About this Episode

    can i use the md5 checksum of the json data as key for each row in react? so context here is that i have a bunch of rows to show, and they dont have an id, and i can't use index as their order may change. so i am using the md5 of the JSON.stringify of the rows data. but i am thinking that calculating the md5 or sha1 maybe a thing which shouldn't happen in the UI render cycle, specially cause the render can happen many times as things in the top change?

    Is using md5 as key an anti-pattern in react?

    Recent Episodes from The Call Kent Podcast

    A Button Per form or One Form with Multiple Buttons

    A Button Per form or One Form with Multiple Buttons

    Hi Kent,

    It's Jan 👋

    When creating a dropdown menu (e.g. to pick a role in an organization), would you wrap the whole menu in a form tag and then render multiple buttons within that form (one for each role)? Or would you render multiple forms (one for each role) with each having their own submit button?

    Thanks a ton if you answer!

    Best regards, Jan

    A Button Per form or One Form with Multiple Buttons

    Toasts in Remix

    Toasts in Remix

    Hi Kent,

    It's Jan.

    I'm currently working on implementing toasts in a Remix app. I was using the Epic Stack as a reference.

    BTW, thank you for creating it, it's so nice to take some features and functionalities from it when you need them!

    Anyways, it looks like the implementation of the toast in the Epic Stack does NOT work with JavaScript disabled. But theoretically, you could make toasts in Remix progressively enhanced by giving the close button a form and prevent default when JavaScript is enabled.

    It looks like the library you're using in the Epic Stack - Sonner - does NOT expose the close button, so you can't progressively enhance it.

    Was it a conscious decision to make the toast JavaScript only? Or let me ask the decision more openly, what are your thoughts on this?

    As always, thanks a ton!

    Toasts in Remix

    Unpaid internships and indentured servitude

    Unpaid internships and indentured servitude

    So, recently I started looking for my first software job. The first offer I received was from a company looking for an intern. The internship had the following conditions: 1) the first 3 months of it are unpaid 2) you have to sign a contract after the 1st month of it that obligates you to stay at the company 2 years after the internship is ended. I rejected it because I felt like you never know what that company may turn out to be. For example, it may try to exploit you and pay you the bare minimum for the job you're doing preventing your career growth and your only option may be to wait for that contract to expire and then start looking for a higher position at another company. I'd like to ask your opinion about:

    • unpaid internships
    • internships that obligate you to stay at the company for 1 or 2 years once the internship is ended
    • companies that follow both of these practices
    Unpaid internships and indentured servitude

    It's fine to re-render

    It's fine to re-render

    My question is around the optimization techniques that a lot of people apply to React apps. I see very often how devs focus on executing their components only once or twice. What I think matters at the end is if there any changes in the actual DOM tree. If not they in theory should be ok to see your functional components fired many times.

    It's fine to re-render
    Logo

    © 2024 Podcastworld. All rights reserved

    Stay up to date

    For any inquiries, please email us at hello@podcastworld.io