react-md-editor icon indicating copy to clipboard operation
react-md-editor copied to clipboard

Doesn't work with typescript

Open bebru2k1 opened this issue 2 years ago • 3 comments

I don't understand why it doesn't work with typescript

image

bebru2k1 avatar Apr 24 '22 05:04 bebru2k1

@bebru2k1 Example: https://codesandbox.io/embed/objective-antonelli-kkojbl?fontsize=14&hidenavigation=1&theme=dark

It works fine.

import { useState } from "react";
import MDEditor from "@uiw/react-md-editor";

const mkdStr = `
\`\`\`javascript
import React from "react";
import ReactDOM from "react-dom";
import MEDitor from '@uiw/react-md-editor';

\`\`\`
`;
export default function App() {
  const [value, setValue] = useState(mkdStr);
  return (
    <div className="App">
      <h3>Auto</h3>
      <MDEditor
        height={200}
        value={value}
        onChange={(value = "") => {
          setValue(value);
        }}
      />
    </div>
  );
}

jaywcjlove avatar Apr 24 '22 08:04 jaywcjlove

i am using nextjs

const MDEditor = dynamic(
  () => import("@uiw/react-md-editor").then((mod) => mod.default),
  { ssr: false }
);

but i changed and it works fine

const MDEditor = dynamic(
  () => import("@uiw/react-md-editor"),
  { ssr: false }
);

bebru2k1 avatar Apr 24 '22 08:04 bebru2k1

@bebru2k1 I'm also using the same in next.js. But unable to run the same in jest test. Getting the error. Any solution on this?

image

jothinayagan-psi avatar Mar 28 '23 09:03 jothinayagan-psi