Skip to content

Commit d2d151a

Browse files
committed
fix build errors
1 parent b2f5766 commit d2d151a

File tree

3 files changed

+3346
-3349
lines changed

3 files changed

+3346
-3349
lines changed

.vscode/settings.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"editor.formatOnSave": true,
33
"editor.codeActionsOnSave": {
4-
"source.fixAll": true,
5-
"source.organizeImports": true
4+
"source.fixAll": "explicit",
5+
"source.organizeImports": "explicit"
66
}
77
}

src/content/learn/howto/extending.md

+4-7
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,14 @@
22
title: Extending ReactUnity
33
---
44

5-
<Intro>
6-
7-
Extending ReactUnity
8-
9-
</Intro>
10-
115
## Declaring custom components
126

137
You can declare custom components in ReactUnity. This is useful when you want to create a component that needs to interact with the underlying backend (`ugui` or `uitoolkit`).
148

159
To declare a custom component, you need to create a new class extending `UGUIComponent` or `UIToolkitComponent` and register it in `UGUIContext.ComponentCreators` or `UIToolkitContext.ComponentCreators` respectively.
1610

1711
### Example
12+
1813
First we create the custom component. For instance, we are declaring a custom button component that has a red background color.
1914

2015
```cs
@@ -53,6 +48,7 @@ public class CustomComponentInitializer : MonoBehaviour
5348
```
5449

5550
### Typescript declaration
51+
5652
You may also need to declare your custom component in Typescript
5753

5854
```ts
@@ -63,7 +59,8 @@ declare global {
6359
}
6460
```
6561

66-
#### Example:
62+
For example:
63+
6764
```ts
6865
declare global {
6966
interface ReactUnityCustomElements {

0 commit comments

Comments
 (0)