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
This commit is contained in:
Alex Krolick
2019-01-01 19:24:46 -08:00
parent e4f43bdf4d
commit 6f6fc8d80e
4 changed files with 8 additions and 0 deletions

View File

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

View File

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

View File

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

View File

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