Revert "md: Replace tsx by ts for highlightjs support"
This reverts commit 8535416acc
.
This commit is contained in:
parent
8535416acc
commit
459e83a0c8
4 changed files with 29 additions and 29 deletions
|
@ -24,7 +24,7 @@ Selon comment vous écrivez le composant, classe ou fonctionnelle, la manière d
|
|||
|
||||
Pour les props :
|
||||
|
||||
```ts
|
||||
```tsx
|
||||
// functional
|
||||
function Welcome(props) {
|
||||
return <h1>Hello, {props.name}</h1>;
|
||||
|
@ -110,9 +110,9 @@ La documentation qui suivra utilisera donc l'écriture fonctionnelle. Pour en sa
|
|||
|
||||
Les props sont des données entrer d'un composant. Comme pour un composant html ils décrivent simplement ce que le composant doit représenter.
|
||||
|
||||
Exemple :
|
||||
Exemple :
|
||||
|
||||
```ts
|
||||
```tsx
|
||||
function Welcome(props) {
|
||||
return <h1>Hello, {props.name}</h1>;
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ Un composant ne possédant pas d'état est dit `stateless`.
|
|||
|
||||
Voici donc un exemple de composant React **avec état** :
|
||||
|
||||
```ts
|
||||
```tsx
|
||||
// Clock.tsx
|
||||
interface IClockProps {
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ export const Clock: React.FC<IClockProps> = (props) => {
|
|||
|
||||
Et voici la version **sans état** :
|
||||
|
||||
```ts
|
||||
```tsx
|
||||
// Clock.tsx
|
||||
interface IClockProps {
|
||||
time: Date
|
||||
|
@ -218,7 +218,7 @@ const [value, setValue] = React.useState(defaultValue);
|
|||
|
||||
Revenons sur l'exemple de `useTicking`:
|
||||
|
||||
```ts
|
||||
```tsx
|
||||
const useTicking = (setTime) => {
|
||||
React.useEffect(() => {
|
||||
// componentDidMount
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue