Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

React Futures - Server Components

import marked from 'marked';
import sanitizeHtml from 'sanitize-html';
// [...]

export default function TextWithMarkdown({text}) {
  return (
    <div
      className="text-with-markdown"
      dangerouslySetInnerHTML={{
        __html: sanitizeHtml(marked(text), {
          allowedTags,
          allowedAttributes,
        }),
      }}
    />
  );
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: Top Tips for Vue 3 Development 
Javascript :: counter example using classes react without jsx 
Javascript :: add even javascript 
Javascript :: javascript for backend 
Javascript :: Solution-4-B--solution options for reverse bits algorithm js 
Javascript :: how to run json server 
Javascript :: javascript reducers 
Javascript :: convert string to number 
Javascript :: password generator and password strength using javascript 
Javascript :: remove decimal places js 
Javascript :: javascript get object methods 
Javascript :: how to define class in javascript 
Javascript :: change string to int javascript 
Javascript :: event solidity 
Javascript :: moment format dates 
Javascript :: nextjs apollo 
Javascript :: electron Uncaught ReferenceError: require is not defined 
Javascript :: emberjs cdn 
Javascript :: port y build - vite.config.js 
Javascript :: javascript prevent more than one click 
Javascript :: javascript variable hoisting 
Javascript :: sign changely api 
Javascript :: javascript Using yield to Pause Execution 
Javascript :: find the missing number in js 
Javascript :: Multiply string using a for loop 
Javascript :: npm function-memoizer 
Javascript :: phaser place on line 
Javascript :: phaser stagger play 1 
Javascript :: how to invoke a function in a class 
Javascript :: javascript concat two htmlcollection 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =