We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import MarkdownEditor from "@uiw/react-markdown-editor"; import { contentAtom } from "atoms/AtomContainer"; import React, { useState } from "react"; import { useRecoilState } from "recoil"; import * as S from "./style"; interface Props extends React.HTMLAttributes<HTMLDivElement> { isContentNull: boolean; } function WriteContent({ isContentNull }: Props) { const [activeIndex, setActiveIndex] = useState<number>(0); const [content, setContent] = useRecoilState(contentAtom); const tabClickHandler = (index: number) => { setActiveIndex(index); }; const tabbar = [ { tabTitle: ( <S.Tabs key="write-part" className={activeIndex === 0 ? "is-active" : ""} onClick={() => tabClickHandler(0)} > 글작성 </S.Tabs> ), tabContent: ( <MarkdownEditor visible={false} hideToolbar={false} onChange={setContent} theme="dark" value={content} /> ), }, { tabTitle: ( <S.Tabs key="preview-part" className={activeIndex === 1 ? "is-active" : ""} onClick={() => tabClickHandler(1)} > 미리보기 </S.Tabs> ), tabContent: <MarkdownEditor.Markdown source={content} />, }, ]; return ( <S.ContentBox isNull={isContentNull}> <S.Tabbar> {tabbar.map((idx) => { return idx.tabTitle; })} </S.Tabbar> <S.Markdown>{tabbar[activeIndex].tabContent}</S.Markdown> </S.ContentBox> ); } export default WriteContent;
In the above code, If you type a backtick(`) three times in the MarkdownEditor, the following error occurs:
Warning: Expected `onClick` listener to be a function, instead got a value of `string` type.
The text was updated successfully, but these errors were encountered:
@jongjin1010 No errors were found. https://codesandbox.io/embed/react-markdown-editor-github-com-uiwjs-react-markdown-editor-issues-195-i3p5wh?fontsize=14&hidenavigation=1&theme=dark
Sorry, something went wrong.
No branches or pull requests
In the above code, If you type a backtick(`) three times in the MarkdownEditor, the following error occurs:
The text was updated successfully, but these errors were encountered: