In this lesson we'll use React Live to preview and edit a component directly in the browser. React Live is a great tool for rendering interactive documentation or any place you would like to demonstrate a React component with a live preview and editing capabilities.

Additional Resources https://github.com/FormidableLabs/react-live

Install:

npm i react-live --save

Code:

import React from 'react';
import {LiveEditor, LivePreview, LiveError, LiveProvider} from 'react-live'; const code = `
class App extends React.Component {
render() {
return (
<div className="App">
<header className="App-header">
<h1 className="App-title">Welcome to React</h1>
</header>
<p className="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p>
</div>
);
}
}`; const AppLive = () => (
<LiveProvider code={code} >
<LiveEditor />
<LivePreview />
<LiveError />
</LiveProvider>
); export default AppLive;

It can work with mdx-deck in presentation: Github

最新文章

  1. twobin博客样式—“蓝白之风”
  2. [No00002E]关于大数据,你不知道的6个迷思
  3. autolayout autoresizing
  4. Pyqt 打包资源文件
  5. [转]Java 8:不要再用循环了
  6. .NET 实现自定义ContextUser的Identity和Principal实现自定义用户信息,权限验证。
  7. c库函数之scanf
  8. Android Studio ndk-Jni开发详细
  9. NOIP 2015 子串
  10. The Building Blocks-Enterprise Applications Part 2- Information Management and Business Analytics
  11. OCP读书笔记(26) - 题库(ExamF)
  12. Dynamics CRM 警惕Odata查询的陷阱
  13. springcolud文章收藏
  14. shell 命令 if elif else fi 用法
  15. 利用python计算多边形面积
  16. 美食查询手机应用&quot;吃了么&quot;:NABC
  17. js 触发 change 事件
  18. Dream------scala--函数定义、流程控制、异常处理
  19. ZH奶酪:IBG项目工作内容
  20. go_接口

热门文章

  1. 【转】自动识别是手机端还是pc端只用一行代码就搞定
  2. 使用python划分数据集
  3. CAD参数绘制圆弧(com接口)
  4. CAD绘制固定圆形标注(网页版)
  5. OpenCV2:应用篇 QT+OpenCV实现图片编辑器
  6. python嵌套列表
  7. PHP实现QQ第三方登录的方法
  8. 源码学习-Object类
  9. LINUX系统---中级相关操作和知识
  10. javascript中点击事件传入this的用法