mirror of
https://github.com/AykutSarac/jsoncrack.com.git
synced 2025-01-20 05:12:54 +08:00
editor disable worker
This commit is contained in:
parent
5d0b45e25c
commit
e0b0591266
@ -1,12 +1,13 @@
|
||||
import React, { ComponentType } from "react";
|
||||
import dynamic from "next/dynamic";
|
||||
import { IAceEditorProps } from "react-ace";
|
||||
import React from "react";
|
||||
import AceEditor from "react-ace";
|
||||
import { StorageConfig } from "src/typings/global";
|
||||
import { useLocalStorage } from "usehooks-ts";
|
||||
import { defaultConfig } from "src/constants/data";
|
||||
import parseJson from "parse-json";
|
||||
import styled from "styled-components";
|
||||
import { Error, ErrorContainer } from "./ErrorContainer";
|
||||
require("ace-builds/src-noconflict/mode-json");
|
||||
require("ace-builds/src-noconflict/theme-tomorrow_night");
|
||||
|
||||
const StyledEditorWrapper = styled.div`
|
||||
display: flex;
|
||||
@ -16,18 +17,6 @@ const StyledEditorWrapper = styled.div`
|
||||
user-select: none;
|
||||
`;
|
||||
|
||||
const AceEditor: ComponentType<IAceEditorProps> = dynamic(
|
||||
async () => {
|
||||
const Ace = require("react-ace").default;
|
||||
require("ace-builds/src-noconflict/mode-json");
|
||||
require("ace-builds/src-noconflict/theme-tomorrow_night");
|
||||
return Ace;
|
||||
},
|
||||
{
|
||||
ssr: false,
|
||||
}
|
||||
);
|
||||
|
||||
function isJson(
|
||||
value: string,
|
||||
setState: React.Dispatch<React.SetStateAction<Error>>
|
||||
@ -121,6 +110,7 @@ const JsonEditor: React.FC<{
|
||||
height="100%"
|
||||
fontSize={14}
|
||||
wrapEnabled
|
||||
setOptions={{ useWorker: false }}
|
||||
/>
|
||||
</StyledEditorWrapper>
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user