-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the ability to use React components inline in Docusaurus markdown #3535
Conversation
Here are a few I could think of
|
Great! These will definitely get us started using the components. If you don't mind I would like to break this out into a new task. This way we can also refer to this PR as a |
…#3535) * add sample inline react components to markdown * update kusama rpc url * clean up and add http request sample component * formatting * ensure to unsubscribe from web socket events when changing pages * remove debugging code
Description
This PR addresses #3533.
Two new functional React components have been added to the repo:
Http-Request-Sample.jsx
Web-Socket-Sample.jsx
These are not yet used anywhere in the codebase, however they can be tested by adding the following lines to any markdown document inline:
This will render something similar to (ignore page context for sample):


or
The first pink or black box is the web socket connection updating the current block number in real-time. The second is a
POST
request made to subscan to retrieve the latest information about an existing block. The web socket will continue to update, while thePOST
will only execute once when the page initially loads but will re-execute upon returning to the page for updated data.Follow-up Tasks
Http-Request-Sample.jsx
component should be able to handle aGET
orPOST
request without creating another component.