Skip to content

Commit 769a842

Browse files
committed
more fixes
1 parent 6d36ce5 commit 769a842

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

ux.symfony.com/cookbook/component_architecture.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ title: Component architecture
33
description: Rules and pattern to work with components
44
image: images/cookbook/component-architecture.png
55
tags:
6-
- javascript
7-
- symfony
6+
- JavaScript
7+
- Symfony
88
author: Mathéo Daninos
99
published_at: '2024-08-02'
1010
---
1111

1212
## Introduction
1313

14-
In SymfonyUX exist two packages: [TwigComponents](https://symfony.com/bundles/ux-twig-component/current/index.html) and [LiveComponent](https://symfony.com/bundles/ux-live-component/current/index.html).
14+
In Symfony UX exist two packages: [TwigComponents](https://symfony.com/bundles/ux-twig-component/current/index.html) and [LiveComponent](https://symfony.com/bundles/ux-live-component/current/index.html).
1515
Those two packages allow you to create reusable components in your Symfony application.
1616
But the component architecture is not exclusive to Symfony, it's a design pattern that can be applied to any programming language or framework.
1717
And the js world already implement this architecture for long time, on many different frameworks like React, Vue, or Svelte.
18-
So, a set of rules and pattern has already be defined to work with components. This is why SymfonyUX try to be as close as possible to those rules.
18+
So, a set of rules and pattern has already be defined to work with components. This is why Symfony UX try to be as close as possible to those rules.
1919
So let's see what are those rules!
2020

2121
## 4 Rules
@@ -119,7 +119,7 @@ And when the loading is done, the state `loading` can be set to `false` and the
119119

120120
***How does it work into Symfony?***
121121

122-
In symfony you 2 different approach to handle state. The first one is to use stimulus directly
122+
In Symfony you 2 different approach to handle state. The first one is to use stimulus directly
123123
in to your component. What we recommend to do is to set a controller stimulus at the root of your component.
124124

125125
```twig
@@ -161,6 +161,8 @@ the following component:
161161
#[AsLiveComponent]
162162
class Button
163163
{
164+
use DefaultActionTrait;
165+
164166
#[LiveProp]
165167
public int $clicks = 0;
166168

0 commit comments

Comments
 (0)