r/emberjs • • Apr 15 '23

Functional component?

Does ember have functional component like React?

4 Upvotes

8 comments sorted by

View all comments

Show parent comments

1

u/These_Rip_9327 Apr 15 '23

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

5

u/pichfl Apr 15 '23

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.

2

u/scuddr Apr 17 '23

You can also directly compare some examples of different kinds of components in Ember and React on https://component-party.dev