Skip to content

Instantly share code, notes, and snippets.

@vvo
Created Nov 17, 2016
Embed
What would you like to do?
esnextbin sketch
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ESNextbin Sketch</title>
<!-- put additional styles and scripts here -->
</head>
<body>
<h1><a href="https://community.algolia.com/instantsearch.js/react/">react-instantsearch</a> demo</h1>
<div id="app"></div>
</body>
</html>
import React from 'react';
import reactElementToJSXString from 'react-element-to-jsx-string';
const Coucou = () => <div>Greg</div>;
document.querySelector('body').textContent = reactElementToJSXString(<Coucou Greg/>);
{
"name": "esnextbin-sketch",
"version": "0.0.0",
"dependencies": {
"react": "15.4.0",
"react-element-to-jsx-string": "5.0.1"
}
}
'use strict';
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _reactElementToJsxString = require('react-element-to-jsx-string');
var _reactElementToJsxString2 = _interopRequireDefault(_reactElementToJsxString);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Coucou = function Coucou() {
return _react2.default.createElement(
'div',
null,
'Greg'
);
};
document.querySelector('body').textContent = (0, _reactElementToJsxString2.default)(_react2.default.createElement(Coucou, { Greg: true }));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment