feat(v2): allow adding components to react-live scope (#2826)

* feat(v2): add components to react-live scope (#2807)

* fix admonition issue + improve react-live scope doc

* fix again admonition :(

* remove forwarding of mdx components to react-live scope (for now)

* remove useless dep
This commit is contained in:
Sébastien Lorber 2020-06-04 14:18:42 +02:00 committed by GitHub
parent 5c6670b94e
commit 953abd8154
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 102 additions and 1 deletions

View file

@ -0,0 +1,15 @@
import React from 'react';
export const ButtonExample = (props) => (
<button
{...props}
style={{
backgroundColor: 'white',
border: 'solid red',
borderRadius: 20,
padding: 10,
cursor: 'pointer',
...props.style,
}}
/>
);

View file

@ -0,0 +1,18 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import React from 'react';
import * as components from './components';
// Add react-live imports you need here
const ReactLiveScope = {
React,
...React,
...components,
};
export default ReactLiveScope;