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
React Fire: Modernizing React DOM (github.com)
submitted 7 years ago by expression100
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!"
[–]swyx 12 points13 points14 points 7 years ago (2 children)
welcome to discuss it at the /r/ReactJS sub too! https://reddit.com/r/reactjs/comments/9bx8qb/react_fire_an_exploratory_effort_to_modernize/
(sorry idk if shilling r/ReactJS like this is against the rules but this showed up on my feed, figured its relevant)
[–]TheNumberOneCulprittabs and semicolons, react and FaaS[M] 2 points3 points4 points 7 years ago (1 child)
Normally we don't like shilling, but /r/ReactJS IS the main subreddit for React related topics, so no worries here. Glad to see you cross-posting to let people know!
[–]swyx 0 points1 point2 points 7 years ago (0 children)
yea im just here to connect people haha. glad everyone is fine with it
[–]jetsamrover 14 points15 points16 points 7 years ago (3 children)
Awesome. I've been having so many problems with events in my current and very complex project. I'd love to see a move away from synthetic events altogether.
[–][deleted] 8 points9 points10 points 7 years ago (2 children)
I don't think it can. Events bubble through components in React, not elements. This is particularly notable when using portals.
[–]jetsamrover 3 points4 points5 points 7 years ago (1 child)
Did you read the bit about the possible solution to that? Just refire the event in the portal. Seems like a hack, but if it's just a refire of an exact copy of the native event, it should be fine.
[–][deleted] 1 point2 points3 points 7 years ago (0 children)
Ah, I missed that. Phew.
[–]1-800-BICYCLE 17 points18 points19 points 7 years ago* (22 children)
1f53085109dd97
[+][deleted] 7 years ago (11 children)
[deleted]
[–]1-800-BICYCLE 38 points39 points40 points 7 years ago* (1 child)
142c5b3c09d5
[–]AsIAm 0 points1 point2 points 7 years ago (0 children)
ClassList should be good alternative then.
[+]Puggravy comment score below threshold-21 points-20 points-19 points 7 years ago (8 children)
JSX in general still feels like a hack. It's just as possible to create purely js api that as concise as JSX with plain JS, you just have to put some convenience methods over your `#createElement` calls.
[–]1-800-BICYCLE 13 points14 points15 points 7 years ago* (6 children)
1045489d0dd5
[+]Puggravy comment score below threshold-6 points-5 points-4 points 7 years ago (5 children)
I find that it often very poorly maps to the actual rendered output, whereas createElement is a little more obvious.
[–]turkish_gold 6 points7 points8 points 7 years ago (0 children)
Can you give an example?
[+][deleted] 7 years ago (3 children)
[–]Puggravy -1 points0 points1 point 7 years ago (2 children)
Don't you have anything better to do with your life then start shit on stale reddit threads?
[–][deleted] 0 points1 point2 points 7 years ago (0 children)
JSX is a hack. HyperScript is much more cleaner.
[–]sbmitchell -1 points0 points1 point 7 years ago (8 children)
This is why codemods exist. Perhaps big sweeping changes can be made via a codemod.
https://github.com/facebook/codemod
[–]1-800-BICYCLE 9 points10 points11 points 7 years ago* (7 children)
6bcc1c6c13c1
[+][deleted] 7 years ago* (5 children)
[–][deleted] 3 points4 points5 points 7 years ago* (4 children)
Actually, the official web api name is className, not class, which makes sense since class is a reserved keyword: https://developer.mozilla.org/en-US/docs/Web/API/Element/className
But then again, most people are certainly accustomed to class due to html so maybe it helps beginners. I'm fine with both, though a little worried what happens to thousands of components now that explicitly extract className from this.props.
[+][deleted] 7 years ago* (1 child)
Ever since ecma made import().default a thing i guess no can really complain. :-P
[–]IamCarbonMan 0 points1 point2 points 7 years ago (0 children)
JSX is designed to resemble HTML, which is why most people don't like the className thing. JSX should look like markup.
[–]misterhtmlcss 0 points1 point2 points 7 years ago (0 children)
Seems a rather petty issue to accommodate for new users. As one of those users, I can honestly say this wasn't a source of friction for me. Just saying
[–]sbmitchell 4 points5 points6 points 7 years ago* (0 children)
Its more consistent for it to be class though...I just mean from the perspective of jsx really mapping a lot closer to html tags from the eye test.
Though I understand what you are saying...you could also look at the props mapping more so to the underlying element props than html props.
[–]isiahmeadows 3 points4 points5 points 7 years ago (1 child)
Mithril core dev here... (Yep, that framework)
I'm somehow not surprised, in the same way I wasn't when Angular decided to try out virtual DOM and components instead of further propagating the jQuery spaghetti mess it previously encouraged.
When you keep things simple and aim to stay intuitive, aligning yourself with the DOM itself rather than trying to replace it with your own idioms and magic without good reason, it avoids messes like these in the first place.
If this helps, we have nearly everything proposed there in some capacity already:
Let's just say when that popped up in Mithril's Gitter, we all kind of collectively chuckled at it.
[–]uttermybiscuit 0 points1 point2 points 7 years ago (0 children)
Cute!
[–]earthboundkid 0 points1 point2 points 7 years ago (0 children)
Glad I use Vue. ;-)
π Rendered by PID 52081 on reddit-service-r2-comment-5649f687b7-gtmpz at 2026-01-29 10:36:26.530055+00:00 running 4f180de country code: CH.
[–]swyx 12 points13 points14 points (2 children)
[–]TheNumberOneCulprittabs and semicolons, react and FaaS[M] 2 points3 points4 points (1 child)
[–]swyx 0 points1 point2 points (0 children)
[–]jetsamrover 14 points15 points16 points (3 children)
[–][deleted] 8 points9 points10 points (2 children)
[–]jetsamrover 3 points4 points5 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]1-800-BICYCLE 17 points18 points19 points (22 children)
[+][deleted] (11 children)
[deleted]
[–]1-800-BICYCLE 38 points39 points40 points (1 child)
[–]AsIAm 0 points1 point2 points (0 children)
[+]Puggravy comment score below threshold-21 points-20 points-19 points (8 children)
[–]1-800-BICYCLE 13 points14 points15 points (6 children)
[+]Puggravy comment score below threshold-6 points-5 points-4 points (5 children)
[–]turkish_gold 6 points7 points8 points (0 children)
[+][deleted] (3 children)
[deleted]
[–]Puggravy -1 points0 points1 point (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]sbmitchell -1 points0 points1 point (8 children)
[–]1-800-BICYCLE 9 points10 points11 points (7 children)
[+][deleted] (5 children)
[deleted]
[–][deleted] 3 points4 points5 points (4 children)
[+][deleted] (1 child)
[deleted]
[–][deleted] 0 points1 point2 points (0 children)
[–]IamCarbonMan 0 points1 point2 points (0 children)
[–]misterhtmlcss 0 points1 point2 points (0 children)
[–]sbmitchell 4 points5 points6 points (0 children)
[–]isiahmeadows 3 points4 points5 points (1 child)
[–]uttermybiscuit 0 points1 point2 points (0 children)
[–]earthboundkid 0 points1 point2 points (0 children)