File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ # docs-react
2+ OpenRPC documentation as a react component
3+
4+ #### What is this?
5+ This is a react component that will render documentation for a given OpenRPC document.
6+
7+ ** Screenshot** :
8+
9+ ![ image] ( https://user-images.githubusercontent.com/364566/54795109-1b1f5b80-4c08-11e9-9ba9-cc2f2d96c692.png )
10+
11+
12+ #### How do I use this?
13+
14+ ##### Installation:
15+ ```
16+ npm install --save @open-rpc/docs-react
17+ ```
18+ ##### Usage:
19+ ```
20+ import Documentation from "@open-rpc/docs-react";
21+ ```
22+ and then use it somewhere:
23+
24+ ```
25+ <Documentation schema={schema} />
26+ ```
27+
28+ ##### In a new project:
29+ Here's how it would be used in a new ` npm init react-app --typescript <appname> ` project:
30+ ```
31+ import React from "react";
32+ import ReactDOM from "react-dom";
33+ import Documentation from "@open-rpc/docs-react";
34+
35+ const schema = {
36+ "info": {
37+ "title": "My New API"
38+ }
39+ };
40+
41+ ReactDOM.render(<Documentation schema={schema} />, document.getElementById("root"));
42+ ```
You can’t perform that action at this time.
0 commit comments