open-rpc / docs-react

OpenRPC documentation as a react component.
10 stars 8 forks source link

Write readme on how to use #9

Closed shanejonas closed 5 years ago

shanejonas commented 5 years ago

docs-react

What is this?

This is a react component that will render documentation for a given OpenRPC document.

Screenshot: image

How do I use this?

Installation:
npm install --save @open-rpc/docs-react
Usage:
import Documentation from "@open-rpc/docs-react";

and then use it somewhere:

<Documentation schema={schema} />
In a new project:

Here's how it would be used in a new npm init react-app --typescript <appname> project:

import React from "react";
import ReactDOM from "react-dom";
import Documentation from "@open-rpc/docs-react";

const schema = {
  "info": {
    "title": "My New API"
  }
};

ReactDOM.render(<Documentation schema={schema} />, document.getElementById("root"));
shanejonas commented 5 years ago

:tada: This issue has been resolved in version 1.0.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket: