项目作者: Qubaish

项目描述 :
Code formatter component for react
高级语言: JavaScript
项目地址: git://github.com/Qubaish/rc-code-formatter.git
创建时间: 2020-04-20T15:10:48Z
项目社区:https://github.com/Qubaish/rc-code-formatter

开源协议:MIT License

下载


Code Formatter Component For React

npm
npm
gzip size

Description

  • Format your code with different color schemes
  • Very light weight and very useful to add code logic in your blogs
  • Stay tunned more functionalities are coming

Installation

  1. npm install rc-code-formatter
  1. import React from 'react';
  2. import CodeFormatter from 'rc-code-formatter';
  3. const myCode = `
  4. import React from 'react';
  5. import ReactDom from 'react-dom';
  6. function App() {
  7. return (
  8. <CodeFormatter theme="dark">
  9. {myCode}
  10. </CodeFormatter>
  11. )
  12. }
  13. `;
  14. function App() {
  15. return (
  16. <CodeFormatter theme="dark">
  17. {myCode}
  18. </CodeFormatter>
  19. )
  20. }
Props Type Description
theme string Property to define your code formatter either light or dark
children string Template literals string of your code

License

MIT