You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/pages/Augmentation.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ export const meta = {
8
8
9
9
## `as` prop
10
10
11
-
Semantic UI React provides a way to compose React components through the `as` prop. It allows to compose component features and props without adding extra nested components.
11
+
Semantic UI React provides a way to compose React components through the `as` prop. It allows composing component features and props without adding extra nested components.
Copy file name to clipboardExpand all lines: docs/src/pages/ShorthandProps.mdx
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ There are several forms of shorthand values that can be provided, but all of the
16
16
17
17
## Object as value
18
18
19
-
Each component's shorthand has associated default element type. For example, by default there is `<Icon />` element rendered for `Button`'s icon shorthand. It is possible to customize props of this default element by providing props object as shorthand value:
19
+
Each component's shorthand has an associated default element type. For example, by default, there is `<Icon />` element rendered for `Button`'s icon shorthand. It is possible to customize props of this default element by providing props object as shorthand value:
20
20
21
21
```jsx
22
22
// 💡 'color' and 'name' will be used as <Icon /> element's props
@@ -57,7 +57,7 @@ It is also possible to pass falsy values (`false`, `null` or `undefined`) - in t
57
57
58
58
## React Element as value
59
59
60
-
There are cases where it might be necessary to customize element tree that will be rendered as a shorthand's value. Returning to `Button` example, we might want to render `<i />` instead of default `<Icon />` element. In that case necessary element might be directly provided as shorthand value:
60
+
There are cases where it might be necessary to customize the element tree that will be rendered as a shorthand's value. Returning to `Button` example, we might want to render `<i />` instead of default `<Icon />` element. In that case, the necessary element might be directly provided as shorthand value:
61
61
62
62
```jsx
63
63
<Button icon={<i className='my-icon'/>} />
@@ -68,25 +68,25 @@ There are cases where it might be necessary to customize element tree that will
68
68
<Message.Content>
69
69
There is a very important caveat here, though: whenever React Element is directly used as a
70
70
shorthand value, all props that Semantic UI React has created for the shorthand's Component will
71
-
be spread on the passed element. This means that provided element should be able to handle props
71
+
be spread on the passed element. This means that the provided element should be able to handle props
72
72
- while this requirement is satisfied for all SUIR components, you should be aware of that when
73
73
either HTML or any third-party elements are provided.
74
74
</Message.Content>
75
75
</Message>
76
76
77
-
Due to this limitation, you should strive to use other options for shorthand values whenever is possible - for instance, this is how previous example can be rewritten:
77
+
Due to this limitation, you should strive to use other options for shorthand values whenever is possible - for instance, this is how the previous example can be rewritten:
78
78
79
79
```jsx
80
80
<Button icon={{ as:'i', className:'my-icon' }} />
81
81
```
82
82
83
-
However, there still might be cases where it would be impossible to use object form of the shorthand value - for example, you might want to render some custom elements tree for the shorthand. In that case function value should be used.
83
+
However, there still might be cases where it would be impossible to use the object form of the shorthand value - for example, you might want to render some custom elements tree for the shorthand. In that case, function value should be used.
84
84
85
85
## Function as value
86
86
87
87
Providing function as a shorthand value is the most involving but, at the same time, the most powerful option for customizing component's shorthand. The only requirements for this function are:
88
88
89
-
- it should finish syncronously
89
+
- it should finish synchronously
90
90
- it should return React Element as a result
91
91
92
92
Thus, in its simplest form, it could be used the following way:
@@ -100,7 +100,7 @@ Thus, in its simplest form, it could be used the following way:
100
100
101
101
## Customizing rendered shorthand
102
102
103
-
There is another use case when render function is very useful for - this is the case where custom element's tree should be rendered for the shorthand. As you might recall, there is a problem that might happen when React Element is provided directly as shorthand value - in that case props are not propagated to rendered. In order to avoid that the following strategy should be considered:
103
+
There is another use case when render function is very useful for - this is the case where custom element's tree should be rendered for the shorthand. As you might recall, there is a problem that might happen when React Element is provided directly as shorthand value - in that case, props are not propagated to rendered. In order to avoid that the following strategy should be considered:
Copy file name to clipboardExpand all lines: docs/src/pages/Theming.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ export const meta = {
8
8
9
9
## Preface
10
10
11
-
Semantic UI React does not have own styling system and fully relies on the theming of
11
+
Semantic UI React does not have its own styling system and fully relies on the theming of
12
12
Semantic UI. It's really powerful, you don't need to know LESS or CSS you can simply
13
13
update values of variables or use styles from predefined themes.
14
14
@@ -33,7 +33,7 @@ In fact, all you know about theming and styling of Semantic UI is fully applicab
33
33
34
34
Semantic UI offers its own build system that uses Gulp and produces prepared CSS files.
35
35
36
-
In all cases we recommend to use the LESS package and tune it into your build system with Webpack. The LESS package also does not depend on Gulp and other cruft things.
36
+
In all cases, we recommend to use the LESS package and tune it into your build system with Webpack. The LESS package also does not depend on Gulp and other cruft things.
37
37
However, this package is not friendly for Webpack and requires additional configuration.
Create React App does not support LESS out of the box, we and propose to use [`@craco/craco`](https://www.npmjs.com/package/@craco/craco) to add its support and avoid `eject`. You have to install required packages:
83
+
Create React App does not support LESS out of the box; we propose to use [`@craco/craco`](https://www.npmjs.com/package/@craco/craco) to add its support and avoid `eject`. You have to install required packages:
Copy file name to clipboardExpand all lines: docs/src/pages/Usage.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ React components can be installed via <code>yarn</code>:
25
25
Themes from Semantic UI >=2.3.x require Semantic UI React >=0.81.0.
26
26
</Message>
27
27
28
-
If you are using TypeScript, you don't need to install anything, typings are included with the package.
28
+
If you are using TypeScript, you don't need to install anything; typings are included with the package.
29
29
30
30
### Theme
31
31
@@ -91,7 +91,7 @@ Semantic UI React is fully supported by all modern JavaScript bundlers.
91
91
92
92
### Create React App
93
93
94
-
Semantic UI React is fully compatible with `create-react-app` and works out the box. Setup of custom theme is covered in [Theming guide](/theming).
94
+
Semantic UI React is fully compatible with `create-react-app` and works out the box. Setting up of custom theme is covered in [Theming guide](/theming).
0 commit comments