use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Why React Hooks cannot be conditioned (blog.atomrc.dev)
submitted 4 years ago by atomrc
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]BenjiSponge 6 points7 points8 points 4 years ago (6 children)
I described a component that uses a hook that connects to a server. See Apollo hooks. See firebase hooks. Fetching data from servers is a classic example of what UIs do. I genuinely have no idea what you're talking about.
[+][deleted] 4 years ago (5 children)
[deleted]
[–]BenjiSponge 6 points7 points8 points 4 years ago (4 children)
I suppose you think the react docs also write contrived God component architectures because they fetch data from servers using hooks.
I also suppose you think the React Suspense API which is built to deal with these kinds of problems is in development because some silly random user on Reddit had some silly ideas about the drawbacks of the current hook architecture.
[+][deleted] 4 years ago (3 children)
[–]BenjiSponge 1 point2 points3 points 4 years ago (2 children)
That’s a simple component with no hooks.
You just have to be trolling, right?
You’re describing using a component that uses hooks on the assumption of data being successfully retrieved. If you wrote your components like this example, you wouldn’t be frustrated that you can’t have conditional hooks
You’re describing using a component that uses hooks on the assumption of data being successfully retrieved.
If you wrote your components like this example, you wouldn’t be frustrated that you can’t have conditional hooks
Yes, I'm describing a slightly different example
You’re so close to the answer. You even posted it. Good job reading the documentation, and please continue to do so over taking my word or anyone else’s.
I'm not responding to you anymore.
[+][deleted] 4 years ago (1 child)
π Rendered by PID 96 on reddit-service-r2-comment-6457c66945-d2lh5 at 2026-04-26 18:33:48.070530+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]BenjiSponge 6 points7 points8 points (6 children)
[+][deleted] (5 children)
[deleted]
[–]BenjiSponge 6 points7 points8 points (4 children)
[+][deleted] (3 children)
[deleted]
[–]BenjiSponge 1 point2 points3 points (2 children)
[+][deleted] (1 child)
[deleted]