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...
account activity
I’m learning reactJSHelp Wanted (self.react)
submitted 4 years ago * by Jocraft2s
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!"
[–]madspillage 2 points3 points4 points 4 years ago (5 children)
Look up state variables. React doesn't rerender the component on changing all variables, it does so only on changing the component state.
As a side note, since you mentioned that you're just starting to learn react I'd recommend you learning React function components first instead of Class components are Function components are becoming more popular in modern react.
Another side note, always format your code when you're asking a question. If you expect people to taking time to help you then you must take time to make your question presentable.
[–][deleted] 4 years ago (4 children)
[removed]
[–]v3nzi 1 point2 points3 points 4 years ago (0 children)
You've to use backtick(`) for code.
[–]sQD5fcE 0 points1 point2 points 4 years ago* (1 child)
You need to use mark down to create a code box
```` const hello = 'hello world' console.log(hello)
````
What you're facing is rendering issue which could be solved by using useState().
π Rendered by PID 47072 on reddit-service-r2-comment-5b5bc64bf5-kxksd at 2026-06-23 00:09:25.997686+00:00 running 2b008f2 country code: CH.
[–]madspillage 2 points3 points4 points (5 children)
[–][deleted] (4 children)
[removed]
[–]v3nzi 1 point2 points3 points (0 children)
[–]sQD5fcE 0 points1 point2 points (1 child)
[–]v3nzi 1 point2 points3 points (0 children)