From d33124c6d25f0b1c38db17c861f643a89e1eb9e1 Mon Sep 17 00:00:00 2001 From: Thomas Hintz Date: Sun, 26 Jul 2020 12:34:28 -0700 Subject: [PATCH] Setting caption? --- high-performance-react.org | 4 ++-- manuscript/fundamentals--building-our-own-react.markua | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/high-performance-react.org b/high-performance-react.org index 1e64bb8..b9f7995 100644 --- a/high-performance-react.org +++ b/high-performance-react.org @@ -179,7 +179,7 @@ children. | props | 'class', 'type', 'disabled' | | children |

, , Hello | -#+BEGIN_SRC +#+BEGIN_SRC :number-lines nil tag name: 'div' tag prop: 'class' children: h1..., 'Hello', input... @@ -574,7 +574,7 @@ and then loop through the current props, setting them accordingly. Of course we filter out the ~children~ prop since we use that elsewhere and it isn't intended to be set directly. -#+NAME: Setting DOM Props +#+CAPTION: Setting DOM Props #+BEGIN_SRC javascript function setDOMProps(element, domElement, prevElement) { if (prevElement) { diff --git a/manuscript/fundamentals--building-our-own-react.markua b/manuscript/fundamentals--building-our-own-react.markua index 1874d8b..722341e 100644 --- a/manuscript/fundamentals--building-our-own-react.markua +++ b/manuscript/fundamentals--building-our-own-react.markua @@ -44,6 +44,7 @@ I see three parts: the name of the tag, the tag's properties, and its children. | props | 'class', 'type', 'disabled' | | children |

, , Hello | +{format: ":number-lines"} ``` tag name: 'div' tag prop: 'class' @@ -311,7 +312,7 @@ function createDOMElement(element) { To set the props on an element we first clear all the existing props and then loop through the current props, setting them accordingly. Of course we filter out the `children` prop since we use that elsewhere and it isn't intended to be set directly. -{format: "javascript", id: "Setting DOM Props"} +{format: "javascript", caption: "Setting DOM Props"} ``` function setDOMProps(element, domElement, prevElement) { if (prevElement) {