@wooritech/code-board-react
v1.0.0-alpha.8
Published
react component that wraps code-board
Downloads
4
Readme
CodeBoardReact
React Component that wraps CodeBoard
install
npm i @wooritech/code-board @wooritech/code-board-react
usage
import React, { useRef, useEffect } from "react";
import { CodeBoardReact } from '@wooritech/code-board-react'
import { PresetType } from '@wooritech/code-board/lib/types'
import "@wooritech/code-board/lib/style.css";
const App = () => {
const cpreset = {
name: "demo",
type: PresetType.STATIC,
files: {
"indexs.js": {
content: 'console.log("hi");'
}
}
};
const cconfig = {
isFixedTemplate: true
}
return (
<div className="App">
<CodeBoardReact preset={cpreset} config={cconfig} />
</div>
);
};
export default App;
style
The style is not applied by default. Please use "@wooritech/code-board/lib/style.css" or copy it to customize.