> you learn that physical media has a limited shelf life.
Their point is that physical media itself has a limited lifespan.
You need to continuously "refresh" it every 1 to 10 years, depending on the physical media you choose, or it's most likely corrupted. I've lost many HDD, SSD, SD cards, and about 50 "archival quality" DVD/CD to time, with all manufacturers having somewhere around 3x to 20x exaggerated claim of longevity. I'm guessing their numbers are based on some temperature/humidity controlled marketing BS, rather than anything resembling reality.
SD Cards are the saddest. I've seen many older members of my family shed tears when they pull out their SD cars they carefully stored in a drawer/safe, and they're junk. Charge drift be a harsh mistress.
Why would it matter what library you use? I'm using React, I do <table> whenever I need to display tabular data, React or no React as no impact on when I'd use <table>.
Just make sure to pass a subscriber to useSyncExternalStore if you decide to venture outside React and use HTMLTable.insertRow, you see react is really smart and won’t let you use this piece of outdated code without punishing you with side effects.
> Just make sure to pass a subscriber to useSyncExternalStore if you decide to venture outside React and use HTMLTable.insertRow, you see react is really smart and won’t let you use this piece of outdated code without punishing you with side effects.
Huh? Why'd you involve state in this or any imperative code? You render the rows/columns as you'd render any other DOM elements in React, pass in the data as props and iterate on it, create children and pass them to render.
Yes, your point? Anyone who spend 15 minutes learning about React learns that you don't manipulate the DOM directly, you let the rendering engine handle that for you.
Or just skip all of the newly released stuff and use React as it was originally made, like me and many others still do. Never suffer from having to debug "useEffect" because we literally never use it. You don't have to use the newest and shiniest toys, especially not those with footguns.
Are you implying that when doing DOM reconciliation, React uses these table-specific insertRow/insertCell APIs for adding and removing elements in tables instead of the regular DOM element APIs it would use for all other elements? I would be surprised if that's the case.
The funny thing is the insertRow/insertCell API just call into DOM manipulation functions like appendChild internally, they just provide some syntactic sugar around things like managing the rows/cells array. It's all the same
reply