Skip to content

Instantly share code, notes, and snippets.

import { useEffect } from 'react';
import loader from '@monaco-editor/loader';
function getCode() {
return [
'[Sun Mar 7 16:02:00 2004] [notice] Apache/1.3.29 (Unix) configured -- resuming normal operations',
'[Sun Mar 7 16:02:00 2004] [info] Server built: Feb 27 2004 13:56:37',
'[Sun Mar 7 16:02:00 2004] [notice] Accept mutex: sysvsem (Default: sysvsem)',
'[Sun Mar 7 16:05:49 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 16:45:56 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
import { useEffect, useState } from 'react';
import Editor from '@monaco-editor/react';
const FileUploader = ({ onFileLoad }) => {
return <input type="file" onChange={(e) => onFileLoad(e.target.files[0])} />;
};
function App() {
const [file, setFile] = useState();
const [value, setValue] = useState();
import { useEffect, useState } from 'react';
import Editor from '@monaco-editor/react';
const FileUploader = ({ onFileLoad }) => {
return <input type="file" onChange={(e) => onFileLoad(e.target.files[0])} />;
};
function App() {
const [file, setFile] = useState();
const [value, setValue] = useState();
import Editor from '@monaco-editor/react';
function App() {
const value = `import logo from './logo.svg';
import './App.css';
function App() {
return (
<div className="App">
<header className="App-header">
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import './abap/abap.contribution';
import './apex/apex.contribution';
import './azcli/azcli.contribution';
import './bat/bat.contribution';
import './bicep/bicep.contribution';
import Editor from '@monaco-editor/react';
function App() {
return (
<Editor height="100vh" language="javascript" value="console.log('Hello, World!');" />
);
}
export default App;
{
"name": "@monaco-editor/react",
"version": "4.4.6",
"description": "Monaco Editor for React - use the monaco-editor in any React application without needing to use webpack (or rollup/parcel/etc) configuration files / plugins",
"author": "Suren Atoyan <[email protected]>",
"main": "lib/cjs/index.js",
"module": "lib/es/index.js",
"unpkg": "lib/umd/monaco-react.min.js",
"jsdelivr": "lib/umd/monaco-react.min.js",
"types": "lib/types.d.ts",
import { useEffect, useMemo, useState } from 'react';
import { Button, Table } from 'antd';
import { EnterOutlined } from '@ant-design/icons';
import styled from 'styled-components';
import {
createNewRow,
createTableData,
getAllParentNodeKeys,
getTableRowCount,
removeRowFromTableData,
import {
adjectives,
animals,
colors,
countries,
uniqueNamesGenerator,
} from 'unique-names-generator';
export const createName = () =>
uniqueNamesGenerator({
import { TreeTable } from './TreeTable';
function App() {
return <TreeTable/>;
}
export default App;