Any web a11y people on here, should <section> have aria-label or aria-labeledby of the heading in the section?
It improves the chrome accessibility tree but voice over doesn't seem different.
IanKDuffy retweeted
useState(fn()) or useState(() => fn()) can make or break your app.
No matter how long you've been working with React, or how many posts, books, and courses you've written, sometimes you miss the simplest things.
Shoutout to @IanKDuffy for pointing this out!
Replying to @akoskm @astrodotbuild
I expect the function inside the useState will trigger each time even though the initial state is set. Try putting a console log inside and you should see it on each state change, but it doesn't overwrite the state.
I believe doing useState(() => function here()) will solve it.
IanKDuffy retweeted
Wait — those screenshots of the checkbox on the WordPress login are actually real?!
💯 thought that was a joke.
IanKDuffy retweeted
Sick of Node truncating your objects when you log them?
Check out `console.dir(obj, { depth: Infinity })`.
IanKDuffy retweeted
Here’s a fuzzy little max-age calculator for you: csswizardry.com/max-age/
Me not touching wordpress for years:
Replying to @wp_acf
You wouldn't have to do all this if you dropped your lawsuits, apologized, and didn't abuse trademarks.
I was actually writing an article on this after seeing in my personal projects, work and code snippets online over the last few weeks.
I'm still polishing it so feedback is welcome.
iankduffy.com/articles/commo…
I suggested using CSS float for something today 😱
And then the dev said they never heard of them. And now I have the trauma of IE with floats and being old enough to have to use them.
Finally got my eslint to work (turns out it was Vs code being a pain) and I think I got a basic first eslint rule to stop useState(someFN())
Just need to improve it more.
So npx lint . works but Vscode isn't telling me they a problem on a fresh nextjs app (it did for a moment, I restarted Vs code and now nothing)
Wonder how people do mocking API responses via jest / vitest ?
I got fetchmock at the moment but sometimes it not the easiest.
I am absolutely loving this new tool, I demoed it today during a presentation on the web performance, especially being able to point env at different ones.
Hopefully they add config where Dev URLs aren't all the same.
developer.chrome.com/blog/we…
IanKDuffy retweeted
If you want all browsers to support it next year, vote in the Interop 2025 issue👍🏻
github.com/web-platform-test…
Do you want to animate the height from 0 to auto? Then start adding this to your CSS reset today.
:root {
interpolate-size: allow-keywords;
}
developer.chrome.com/docs/cs…
Been messing with the new @ChromiumDev performance tab, and it definitely helps spot partial elements with INP.
My one wish is you could give it dev /test URLs to compare to live, you are able to origins but my Dev / test URLs tend to be different.
IanKDuffy retweeted
Cuckoo Fibre today made all of their Front End Developers redundant so I am looking for a new role. If you hear of any opportunities or just want to catch up, please send me a message.
About me & what I’m looking for:
💼 Principal Frontend Developer with 24 years experience building for the web.
💅 A Senior Designer before switching fully to Front End Development in 2011.
🌎 Open to hybrid roles in Leeds.
⭐ Previously worked at Sky Sports, Sky Bet, William Hill, and others.
👔 Contract and Freelance experience working for The Premier League, Betfair, and Shell.
😄 Pretty friendly guy
#WebDevelopment #FrontEnd













![// Avoid - getInitialSelection is needlessly invoked on every render. const [selection, setSelection] = useState(getInitialSelection()) // Prefer - React only invokes the function on the first render const [selection, setSelection] = useState(getInitialSelection)](https://pbs.twimg.com/media/GY95pazWwAAy2p5.jpg?name=small&format=webp)




