Skip to content

Commit f3c67d7

Browse files
committed
type: fix type error.
1 parent 8d29326 commit f3c67d7

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Diff for: core/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ https://uiwjs.github.io/react-textarea-code-editor/
3939
[![Open in Github gh-pages](https://img.shields.io/badge/Open%20In-Github%20gh--pages-blue?logo=github)](https://uiwjs.github.io/react-textarea-code-editor/)
4040

4141
```jsx
42+
import React, { useState } from "react";
4243
import CodeEditor from '@uiw/react-textarea-code-editor';
4344

44-
function App() {
45-
const [code, setCode] = React.useState(
45+
export default function App() {
46+
const [code, setCode] = useState(
4647
`function add(a, b) {\n return a + b;\n}`
4748
);
4849
return (
@@ -53,7 +54,6 @@ function App() {
5354
onChange={(evn) => setCode(evn.target.value)}
5455
padding={15}
5556
style={{
56-
fontSize: 12,
5757
backgroundColor: "#f5f5f5",
5858
fontFamily: 'ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace',
5959
}}

Diff for: core/src/utils.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
import { PluggableList } from 'unified';
1+
import { PluggableList, Pluggable } from 'unified';
22
import { rehype } from 'rehype';
33
import rehypePrism from 'rehype-prism-plus';
44

5-
export const processHtml = (html: string, plugins: PluggableList = [[rehypePrism, { ignoreMissing: true }]]) => {
5+
export const processHtml = (
6+
html: string,
7+
plugins: PluggableList = [[rehypePrism, { ignoreMissing: true }]] as Pluggable[],
8+
) => {
69
return rehype()
710
.data('settings', { fragment: true })
811
.use([...plugins])

0 commit comments

Comments
 (0)