You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{defaultValueCtx,Editor,rootCtx}from"@milkdown/kit/core";importtype{FC}from"react";import{Milkdown,useEditor}from"@milkdown/react";import{commonmark}from"@milkdown/kit/preset/commonmark";import{nord}from"@milkdown/theme-nord";import{history}from"@milkdown/kit/plugin/history";import"@milkdown/theme-nord/style.css";import"@milkdown/crepe/theme/common/style.css";// We have some themes for you to choose// available themes: frame, classic, nord, frame-dark, classic-dark, nord-darkimport"@milkdown/crepe/theme/frame.css";constmarkdown=`# Milkdown React Commonmark> You're scared of a world where you're needed.This is a demo for using Milkdown with **React**.`;exportconstMilkdownEditor: FC=()=>{useEditor((root)=>{returnEditor.make().config((ctx)=>{ctx.set(rootCtx,root);ctx.set(defaultValueCtx,markdown);}).config(nord).use(commonmark).use(history)},[]);return<Milkdown/>;
};
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
this is my code
Beta Was this translation helpful? Give feedback.
All reactions