I feel like TDD's usefulness depends very much on what type of code you're writing.
If it's C libraries that fiddle that do lots of munging of variables, like positioning UI or fiddling with data structures... then yes, totally, it has well-defined requirements that you can assert in tests before you write it.
If it's like React UI code, though, get out of here. You shouldn't even really be writing unit tests for most of that (IMO), much less blocking on writing it first. It'll probably change 20 times before it's done anyway; writing the tests up from is going to just be annoying.
Definitely agree. In the time it took you to mock your the state management, the backend endpoints, and the browser localStorage to isolate your unit, you probably could have written it in Playwright end-to-end with nothing mocked. The you'd actually know if your react code broke when the API changed, instead of pretending your out of date mock is still in sync.
If it's C libraries that fiddle that do lots of munging of variables, like positioning UI or fiddling with data structures... then yes, totally, it has well-defined requirements that you can assert in tests before you write it.
If it's like React UI code, though, get out of here. You shouldn't even really be writing unit tests for most of that (IMO), much less blocking on writing it first. It'll probably change 20 times before it's done anyway; writing the tests up from is going to just be annoying.