Update snippet descriptions

This commit is contained in:
Isabelle Viktoria Maciohsek
2020-10-22 20:24:30 +03:00
parent d35575373f
commit 5cb69e3c5c
58 changed files with 195 additions and 126 deletions

View File

@ -5,9 +5,9 @@ tags: browser,recursion,advanced
Renders the given DOM tree in the specified DOM element.
- Destructure the first argument into `type` and `props`, use `type` to determine if the given element is a text element.
- Destructure the first argument into `type` and `props`, using `type` to determine if the given element is a text element.
- Based on the element's `type`, use either `Document.createTextNode()` or `Document.createElement()` to create the DOM element.
- Use `Object.keys(props`, adding attributes to the DOM element and setting event listeners, as necessary.
- Use `Object.keys()` to add attributes to the DOM element and setting event listeners, as necessary.
- Use recursion to render `props.children`, if any.
- Finally, use `Node.appendChild()` to append the DOM element to the specified `container`.