Skip to content

Commit f1fa2f7

Browse files
committed
readme, #71
1 parent 692a3de commit f1fa2f7

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,15 @@ require('codemirror/mode/javascript/javascript');
149149
- `onUpdate(editor, event)` - *[update](https://codemirror.net/doc/manual.html#event_update)*
150150
- `onViewportChange(editor, from, to)` - *[viewportChange](https://codemirror.net/doc/manual.html#event_viewportChange)*
151151

152-
## misc. notes
152+
## FAQ
153153

154-
- server rendering
154+
- Is server side rendering supported?
155155

156-
react-codemirror2 will prevent rendering in absence of `navigator` that is typical of a server environment. In case of any issue, you can force the component to not render via a `PREVENT_CODEMIRROR_RENDER` global variable that this wrapper respond to.
156+
Yes. react-codemirror2 will prevent rendering in absence of `navigator`. You can also force the component to not render via a `PREVENT_CODEMIRROR_RENDER` global.
157157

158-
- getting the instance
158+
- How can I get the instance?
159159

160-
getting the instance of the underlying editor can be done via the event callbacks where `editor` is returned. There is no static method to get it on demand, e.g. `CodeMirror.getInstance()`. The recommended approach can be observed as follows...
160+
The recommended technique to get the instance is to persist the `editor` returned via event callbacks. There is no static method to get it on demand, e.g. `CodeMirror.getInstance()`. Example...
161161

162162
```jsx
163163
constructor() {
@@ -169,5 +169,9 @@ render() {
169169
}
170170
```
171171

172+
- How can I make a resizable editor?
173+
174+
Check out [bokuweb/re-resizable](https://github.com/bokuweb/re-resizable) to wrap the editor in `<Resizable/>` components
175+
172176

173177
[MIT](./LICENSE) © 2018 [scniro](https://github.com/scniro)

0 commit comments

Comments
 (0)