hexo-renderer-react
Render ES6 React components as hexo templates
Install
$ npm install hexo-renderer-react react react-dom --save
This requires you to have react
installed as well.
Usage
- Name your components with the
.jsx
extension export default
ormodule.exports =
your component class- ES6/7 syntax and JSX is handled by
babel
Version 6.babelrc
Config file preset requirements:
Examples
layout.jsx
; Component { return <html> <head> <title>thispropspagetitle</title> </head> <body> <main dangerouslySetInnerHTML=__html: thispropspagebody /> </body> </html> ; }
post.jsx
; Component { return <div> <h3>POST: thispropspagetitle</h3> <div>thispropspagedate</div> </div> }
License
This software is free to use under the MIT license. See the LICENSE-MIT file for license text and copyright information.