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
Then you can use it to create React elements without JSX:
37
+
この後、JSX を使わずに React 要素を作成することができます。
38
38
39
39
```js
40
40
exportdefaultfunctionApp() {
@@ -46,33 +46,33 @@ export default function App() {
46
46
}
47
47
```
48
48
49
-
[See more examples below.](#usage)
49
+
[さらに例を見る](#usage)
50
50
51
-
#### Parameters {/*parameters*/}
51
+
#### 引数 {/*parameters*/}
52
52
53
-
*`type`: The `type`argument must be a valid React component type. For example, it could be a tag name string (such as `'div'`or`'span'`), or a React component (a function, a class, or a special component like [`Fragment`](/reference/react/Fragment)).
Returns a factory function. That factory function receives a `props`object as the first argument, followed by a list of `...children`arguments, and returns a React element with the given `type`, `props` and `children`.
Although most React projects use [JSX](/learn/writing-markup-with-jsx)to describe the user interface, JSX is not required. In the past, `createFactory`used to be one of the ways you could describe the user interface without JSX.
Calling that factory function will produce React elements with the props and children you have provided:
75
+
そのファクトリ関数を呼び出すと、指定した props と children を持つ React 要素が生成されます。
76
76
77
77
<Sandpack>
78
78
@@ -92,15 +92,15 @@ export default function App() {
92
92
93
93
</Sandpack>
94
94
95
-
This is how `createFactory`was used as an alternative to JSX. However, `createFactory`is deprecated, and you should not call `createFactory`in any new code. See how to migrate away from `createFactory`below.
If you have a few `createFactory`calls that you don't mind porting manually, and you don't want to use JSX, you can replace every call a factory function with a [`createElement`](/reference/react/createElement)call. For example, you can replace this code:
0 commit comments