Poi ships with many webpack loaders included, but you may run into scenarios where you'll need to customize and add your own. This lesson covers adding react-markdown-loader to Poi to load Markdown files as React components.

Install:

npm i -D react-markdown-loader

poi.config.js:

module.exports = {
webpack(config) {
config.module.rules.push({
test: '/.md$/',
loaders: [
'babel-loader',
'react-markdown-loader'
]
}) return config;
}
}
import Page from './Page.md'
import {render} from 'react-dom'; render(
<Page></Page>,
document.getElementById('app')
);

[Poi] Use Markdown as React Components by Adding a Webpack Loader to Poi的更多相关文章

  1. [React] Create and import React components with Markdown using MDXC

    In this lesson I demonstrate how to use the library MDXC to create and import React components with ...

  2. [React] Styling React Components With Aphrodite

    Aphrodite is a library styling React components. You get all the benefits of inline styles (encapsul ...

  3. Rendering React components to the document body

    React一个比较好用的功能是其简单的API,一个组件可以简单到一个return了组件结构的render函数.除了一个简单的函数之外,我们还有了一段有用且可复用的代码片段. 问题 不过有时候可能会受到 ...

  4. React Components Template

    React Components Template "use strict"; /** * * @author xgqfrms * @license MIT * @copyrigh ...

  5. React Components之间的通信方式了解下

    先来几个术语: 官方 我的说法 对应代码 React element React元素 let element=<span>A爆了</span> Component 组件 cla ...

  6. [React] Recompose: Theme React Components Live with Context

    SASS Bootstrap allows us to configure theme or branding variables that affect all components (e.g. P ...

  7. React components render order All In One

    React components render order All In One components render order / components lifecycle DOM tree ren ...

  8. 配置React的Babel 6和Webpack 2环境

    Facebook的一帮子工程师在忙碌之余开发除了一套前段UI框架React.这个框架最大的有点就在于让UI的开发都基于组件,这样View都是根据props和state变化的. 项目地址:https:/ ...

  9. 二、react开发环境配置与webpack入门

    Webpack 模块打包工具(module bundler)功能: 将 CSS.图片与其他资源打包 打包之前预处理(Less.CoffeeScript.JSX.ES6 等)档案 依 entry 文件不 ...

随机推荐

  1. canvas处理图片

    canvas绘制图片的三种方法: drawImage(image, x, y) drawImage(image, x, y, width, height) drawImage(image, sourc ...

  2. Dapper丶DapperExtention,以及AbpDapper之间的关系,

    在一些开发上,由于系统的迭代上面,不能立即使用ABP框架一些框架,框架是死的,框架是死的,框架中的一些东西很值得我们学习.例如DDD架构设计,Dto数据传输对象,以及AutoMapper.仓储,依赖注 ...

  3. java 获取config 配置文件

    static ResourceBundle PropertiesUtil = ResourceBundle.getBundle("config"); public static S ...

  4. Linux 和 Windows 双系统时间同步问题 修改注册表

    路径:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation 1:新建  >> DWORD(32 b ...

  5. 紫书 例题11-7 UVa 753 (网络流最大流)

    设一个源点, 到所有设备连一条弧, 容量为1, 然后设一个汇点, 所有插座到汇点连弧, 容量为1, 然后 转换器也连一条弧, 容量为1. 最后最大流就是答案.其中注意节点数要开大一些. #includ ...

  6. 05004_Linux的其他命令和权限命令

    1.其他命令 (1)显示当前所在位置 命令:pwd (2)搜索命令 a.命令:grep 要搜索的字符串 要搜索的文件 示例:搜索/etc/sudu.conf文件中包含字符串to的行 b.搜索/etc/ ...

  7. 【图灵杯 F】一道简单的递推题(矩阵快速幂,乘法模板)

    Description 存在如下递推式: F(n+1)=A1*F(n)+A2*F(n-1)+-+An*F(1) F(n+2)=A1*F(n+1)+A2*F(n)+-+An*F(2) - 求第K项的值对 ...

  8. 基于LevelDB的高可用ActiveMQ集群

    基于LevelDB的高可用ActiveMQ集群 http://donald-draper.iteye.com/blog/2347913

  9. 洛谷 P2027 bf

    P2027 bf 题目描述 bf是一种编程语言,全称为BrainFuck,因为题目名称不能太露骨,所以就简写成bf了. 这种语言的运行机制十分简单,只有一个大小为30000的有符号8位整数(范围[-1 ...

  10. Qt之QSpacerItem

    简述 QSpacerItem类为布局提供了一个空白区. 简述 比对 使用 效果 源码 效果 源码 比对 通常情况下,不需要直接使用这个类,Qt内建布局管理器在操控空白区时提供以下功能: 类 函数 QH ...