Skip to content

Next.JS Implementation #38

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
jonrrivera opened this issue Oct 29, 2020 · 7 comments
Closed

Next.JS Implementation #38

jonrrivera opened this issue Oct 29, 2020 · 7 comments

Comments

@jonrrivera
Copy link

jonrrivera commented Oct 29, 2020

Hey,

Thanks for the great repo. I found that I cant use this in my next.js app because all global CSS has to be declared on the root component. if there a way to use this without the CSS? I think that should make it work.

Screen Shot 2020-10-29 at 3 10 19 PM

Please let me know if you need any more details. thank you!

@jonrrivera jonrrivera changed the title Next. Next.JS Implementation Oct 29, 2020
@jaywcjlove
Copy link
Member

@jonrrivera uiwjs/react-md-editor#52 Hope it helps you.

@jaywcjlove
Copy link
Member

@jaywcjlove
Copy link
Member

uiwjs/react-md-editor#52 (comment)

I created a nextjs package next-remove-imports to solve the problem.

@jaywcjlove
Copy link
Member

@jonrrivera

@AnderUstarroz
Copy link

I made it work by adding this to my next.config.js file:

const removeImports = require("next-remove-imports")({});

const nextConfig = removeImports({
 your config here...
 ...
 ...
});

module.exports = nextConfig;

And the following within my page:

import { MarkdownPreviewProps } from "@uiw/react-markdown-preview";


const MarkdownPreview = dynamic<MarkdownPreviewProps>(
  () => import("@uiw/react-markdown-preview"),
  {
    ssr: false,
  }
);

const MyPage: NextPage = () => {
  return (<div><MarkdownPreview source={"Some **markdown** text"} /></div>)
}

@jaywcjlove
Copy link
Member

jaywcjlove commented Oct 21, 2022

@papito1992
Copy link

Has anyone figured out how to add custom commands in nextjs? seems to work with the default settings but i have no idea how to add more custom headings other than the one provided to the toolbar.

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

No branches or pull requests

4 participants