mirror of
https://github.com/Kong/insomnia
synced 2024-11-12 17:26:32 +00:00
23 lines
498 B
TypeScript
23 lines
498 B
TypeScript
import React, { createRef, PureComponent } from 'react';
|
|
|
|
export class MockCodeEditor extends PureComponent<any> {
|
|
ref = createRef<HTMLTextAreaElement>();
|
|
|
|
setSelection() {}
|
|
|
|
focus() {
|
|
this.ref.current?.focus();
|
|
}
|
|
|
|
render() {
|
|
const { id, onChange, placeholder, defaultValue } = this.props;
|
|
return <textarea
|
|
ref={this.ref}
|
|
id={id}
|
|
onChange={e => onChange(e.currentTarget.value)}
|
|
placeholder={placeholder}
|
|
defaultValue={defaultValue}
|
|
/>;
|
|
}
|
|
}
|