Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 1 year ago

Markdown editor, React, Typescript, React-markdown, Recoil

react, recoil, typescript, next
Kamil Szymon•700
@kamiliano1
A solution to the In-browser markdown editor challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


React Recoil

To manage the state I've used

markdownAtom.ts;

type MarkdownDataType = {
  createdAt: string;
  name: string;
  content: string;
  id: string;
};

  data: MarkdownDataType[];
  isLightMode: boolean;
  isSidebarOpen: boolean;
  isDeleteModalOpen: boolean;
  activatedMarkdownPart: ActivatedPartType;
  activeMarkdownId: string;
  inputMarkdownValue: string;
  isReloaded: boolean;

isReloaded is created to prevent the infinite loop

React-markdown

The first time I used it. Was surprisingly easy to implement markdown to the project. More work was done with formatting elements to match the design.

Radix-UI

To improve accessibility:

  • radix-ui/react-switch - light and dark mode switcher
  • radix-ui/react-dialog - delete markdown modal
  • radix-ui/react-navigation-menu - navbar and sidebar with keyboard navigation
Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Kamil Szymon's solution.

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License