-
Notifications
You must be signed in to change notification settings - Fork 781
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename VNode
data
property to props
.
- Loading branch information
1 parent
d6322fc
commit fc9cf72
Showing
11 changed files
with
112 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,12 +5,12 @@ A vnode or vnode is a JavaScript object that describes a DOM tree. | |
```js | ||
{ | ||
tag: "div", | ||
data: { | ||
props: { | ||
id: "app" | ||
}, | ||
children: [{ | ||
tag: "h1", | ||
data: {}, | ||
props: {}, | ||
children: ["Hi."] | ||
}] | ||
} | ||
|
@@ -42,22 +42,24 @@ const node = ( | |
|
||
## Attributes | ||
|
||
The data property can include any valid attributes: [HTML](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes), [SVG](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute), [DOM events](https://developer.mozilla.org/en-US/docs/Web/Events), [VDOM events](/docs/vdom-events.md) and [keys](/docs/keys.md). | ||
Also referred to as props, can include any valid [HTML](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes) or [SVG](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute) attributes, [DOM events](https://developer.mozilla.org/en-US/docs/Web/Events), [VDOM events](/docs/vdom-events.md) and [keys](/docs/keys.md). | ||
|
||
```jsx | ||
const button = ( | ||
<button | ||
class="ui button" | ||
tabindex={0} | ||
style={{ | ||
fontSize: "3em" | ||
}} | ||
onclick={() => { | ||
// ... | ||
}} | ||
> | ||
Click Me | ||
</button> | ||
const button = h( | ||
"button", | ||
{ | ||
props: { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
okwolf
Contributor
|
||
class: "ui button", | ||
tabindex: 0, | ||
style: { | ||
fontSize: "3em" | ||
}, | ||
onclick() { | ||
// ... | ||
} | ||
} | ||
}, | ||
["Click Me"] | ||
) | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
wrong