Fixed too early initialize
parent
68388f693a
commit
65406447f5
|
@ -1,16 +1,29 @@
|
|||
import * as loader from "tc-loader";
|
||||
import {Stage} from "tc-loader";
|
||||
|
||||
import * as React from "react";
|
||||
import {Context} from "react";
|
||||
|
||||
import TextRenderer from "vendor/xbbcode/renderer/text";
|
||||
import ReactRenderer from "vendor/xbbcode/renderer/react";
|
||||
import HTMLRenderer from "vendor/xbbcode/renderer/html";
|
||||
|
||||
export const BBCodeHandlerContext = React.createContext<string>(undefined);
|
||||
|
||||
export const rendererText = new TextRenderer();
|
||||
export const rendererReact = new ReactRenderer();
|
||||
export const rendererHTML = new HTMLRenderer(rendererReact);
|
||||
|
||||
import "./emoji";
|
||||
import "./highlight";
|
||||
import "./youtube";
|
||||
import "./url";
|
||||
import "./image";
|
||||
import * as React from "react";
|
||||
|
||||
export let BBCodeHandlerContext: Context<string>;
|
||||
|
||||
export const rendererText = new TextRenderer();
|
||||
export const rendererReact = new ReactRenderer();
|
||||
export const rendererHTML = new HTMLRenderer(rendererReact);
|
||||
|
||||
loader.register_task(Stage.JAVASCRIPT_INITIALIZING, {
|
||||
name: "BBCode handler context",
|
||||
function: async () => {
|
||||
BBCodeHandlerContext = React.createContext<string>(undefined);
|
||||
},
|
||||
priority: 80
|
||||
})
|
Loading…
Reference in New Issue