Skip to content
New issue

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

Doesn't work with typescript #379

Open
bebru2k1 opened this issue Apr 24, 2022 · 3 comments
Open

Doesn't work with typescript #379

bebru2k1 opened this issue Apr 24, 2022 · 3 comments

Comments

@bebru2k1
Copy link

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

image

@jaywcjlove
Copy link
Member

@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>
  );
}

@bebru2k1 bebru2k1 changed the title Doesn't Ưork with typescript Doesn't work with typescript Apr 24, 2022
@bebru2k1
Copy link
Author

bebru2k1 commented Apr 24, 2022

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 }
);

@jothinayagan-psi
Copy link

jothinayagan-psi commented Mar 28, 2023

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants