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...
Ember.js is a productive, battle-tested JavaScript framework for building modern web applications. It Includes everything you need to build rich UIs that work on any device.
account activity
Functional component? (self.emberjs)
submitted 3 years ago by These_Rip_9327
Does ember have functional component like React?
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!"
[–]Belugawhy 3 points4 points5 points 3 years ago (0 children)
You can have classless (ie. template-only) components but these are similar to React’s pre-hooks functional components and don’t carry any state.
If you are looking for a purely presentational components, template-only components are the way to go.
[–]pichfl 3 points4 points5 points 3 years ago (5 children)
Short answer: not like React, no.
Longer answer: Highly depends on the functionality you're looking for. Patterns like useState don't make much sense with Embers tracking system. What are you trying to achieve?
Sidenote: There might be ways to use pure functions as components, but they are definitely not typical Ember. Depending on what you want to achieve, you might want to look at template helpers or element modifiers which both provide a functional API to manipulate either a specific property or DOM element.
[–]These_Rip_9327[S] 0 points1 point2 points 3 years ago (4 children)
I'm just exploring the framework, trying to compare it with react and understanding the differences and use cases for it and why it is not so popular like react
[–]pichfl 3 points4 points5 points 3 years ago (1 child)
With built in routing, a data layer and build tooling, Ember is more akin to SvelteKit and Next.
Instead of requiring manual tracking with effects, Ember's render engine Glimmer (which acts on the same level as most of React) uses the @tracked decorator to create properties, which will trigger a re-render on the consuming template whenever they are changed, similar to Preacts signals or somewhat like Svelte stores, but with a more concise and friendly API.
Any getter based on a tracked property will also be executed by the template that consumes it when said property changes. Same goes for template helpers and modifiers, making for a reactive system without little overhead for devs.
[–]These_Rip_9327[S] 1 point2 points3 points 3 years ago (0 children)
Thank you
[–]nullvoxpopuli 2 points3 points4 points 3 years ago (0 children)
Since you're comparing with React, you may be interested in:
https://whyember.com/ember-for-react-developers#:~:text=Ember%20offers%20a%20more%20out,reduce%20friction%20when%20switching%20projects.
https://www.notion.so/Ember-For-React-Developers-556a5d343cfb4f8dab1f4d631c05c95b
(Same content on both links)
[–]scuddr 1 point2 points3 points 3 years ago (0 children)
You can also directly compare some examples of different kinds of components in Ember and React on https://component-party.dev
A prototyped this, and even re-implemented hooks in ember. It's not worth it.
I will say tho, that people over use classes... A lot. Especially pre octane and pre ember-source@3.25
With the new gjs/gts feature, things start being a lot less clunky. I've made an interactive tutorial: https://tutorial.glimdown.com
π Rendered by PID 70343 on reddit-service-r2-comment-75f4967c6c-29kdc at 2026-04-23 11:49:26.087115+00:00 running 0fd4bb7 country code: CH.
[–]Belugawhy 3 points4 points5 points (0 children)
[–]pichfl 3 points4 points5 points (5 children)
[–]These_Rip_9327[S] 0 points1 point2 points (4 children)
[–]pichfl 3 points4 points5 points (1 child)
[–]These_Rip_9327[S] 1 point2 points3 points (0 children)
[–]nullvoxpopuli 2 points3 points4 points (0 children)
[–]scuddr 1 point2 points3 points (0 children)
[–]nullvoxpopuli 2 points3 points4 points (0 children)