IanKDuffy (@IanKDuffy) header
IanKDuffy (@IanKDuffy) profile picture

Senior JavaScript Engineer - Next JS | Ruby on Rails | SCSS | NodeJS He/Him https://teapaw.org/t.co/W9eMwpzY7Q

Newcastle Upon Tyne, England
Joined January 2015
Photo by IanKDuffy (@IanKDuffy)Photo by IanKDuffy (@IanKDuffy)Photo by IanKDuffy (@IanKDuffy)Photo by IanKDuffy (@IanKDuffy)Photo by IanKDuffy (@IanKDuffy)Photo by IanKDuffy (@IanKDuffy)Photo by IanKDuffy (@IanKDuffy)Photo by IanKDuffy (@IanKDuffy)Photo by IanKDuffy (@IanKDuffy)Photo by IanKDuffy (@IanKDuffy)
Moving to the other place.
102
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.
1
111
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!
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.
1
1
2
434
IanKDuffy retweeted
Ok, this is getting ridiculous...
18
37
15
408
32,727
IanKDuffy retweeted
Wait — those screenshots of the checkbox on the WordPress login are actually real?! 💯 thought that was a joke.
36
5
1
553
79,397
Sick of Node truncating your objects when you log them? Check out `console.dir(obj, { depth: Infinity })`.
35
169
13
2,052
126,248
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.
1
88
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…
Just saw this performance mistake in a React code review. Problem: If you invoke a function in useState's default, it's called on every render. (Not React's fault - that's how JS works). Solution: Specify a function reference instead. Then React only invokes the function once.
1
60
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.
31
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.
30
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)
26
I have no idea why eslint doesn't work on my MacBook now 🙃
1
28
Wonder how people do mocking API responses via jest / vitest ? I got fetchmock at the moment but sometimes it not the easiest.
1
1
57
2
7
42
4,206
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…
1
42
Where I mean the same, sometimes our URLs are slightly different for various reasons like testing, so it be great to forward a whole URL to another.
24
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.
39
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
11
1
8
1,753