Browse Source

clarify mountNode with comments

This is still a bit opaque but it's difficult to fix with the current way
CodeEditor works:
- long-term CodeEditor.js could take a node reference instead of defining
  mountNode internally
- could also use document.createElement to define the target in the code,
  but this could be mislead people to think this is required instead of
  using an existing reference

see #1017, #1018, #1019
main
Alex Krolick 6 years ago
parent
commit
6f6fc8d80e
  1. 2
      content/home/examples/a-component-using-external-plugins.js
  2. 2
      content/home/examples/a-simple-component.js
  3. 2
      content/home/examples/a-stateful-component.js
  4. 2
      content/home/examples/an-application.js

2
content/home/examples/a-component-using-external-plugins.js

@ -36,4 +36,6 @@ class MarkdownEditor extends React.Component {
}
}
// let mountNode = document.querySelector('#markdown')
ReactDOM.render(<MarkdownEditor />, mountNode);

2
content/home/examples/a-simple-component.js

@ -8,6 +8,8 @@ class HelloMessage extends React.Component {
}
}
// let mountNode = document.querySelector('#message')
ReactDOM.render(
<HelloMessage name="Taylor" />,
mountNode

2
content/home/examples/a-stateful-component.js

@ -27,4 +27,6 @@ class Timer extends React.Component {
}
}
// let mountNode = document.querySelector('#timer')
ReactDOM.render(<Timer />, mountNode);

2
content/home/examples/an-application.js

@ -60,4 +60,6 @@ class TodoList extends React.Component {
}
}
// let mountNode = document.querySelector('#app')
ReactDOM.render(<TodoApp />, mountNode);

Loading…
Cancel
Save