MCPcopy Index your code
hub / github.com/reactide/reactide / componentDidMount

Method componentDidMount

renderer/components/TextEditor.js:151–177  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

149
150
151 componentDidMount() {
152 const path = window.require('path');
153 const fs = window.require('fs');
154 var file = fs.readFileSync(this.props.path, { encoding: 'utf8' });
155 // initialize editor
156 this.editor = monaco.editor.create(document.getElementById('editor-container'),
157 {
158 language: this._getLanguage(this.props.path),
159 theme: 'ayu-dark',
160 lineNumbers: 'on',
161 wordWrap: 'on',
162 scrollBeyondLastLine: false,
163 automaticLayout: true,
164 glyphMargin: true
165
166 },
167
168 );
169
170
171 // Intialize the linter
172 this._linterWorker = new ESLintWorker();
173 this._linterWorker.addEventListener('message', (message) => { this._updateMarkers(message); });
174
175 this._openFile(this.props.path);
176
177 }
178
179 componentDidUpdate(prevProps) {
180 const { path/*, ...rest*/ } = this.props;

Callers

nothing calls this directly

Calls 3

_getLanguageMethod · 0.95
_updateMarkersMethod · 0.95
_openFileMethod · 0.95

Tested by

no test coverage detected