mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-04 21:15:47 +00:00
Add Code Sandbox template to README (#2177)
* Add sandbox to README * Add it to the specific usage section
This commit is contained in:
13
README.md
13
README.md
@@ -63,6 +63,16 @@ main()
|
|||||||
|
|
||||||
For more examples, see the [documentation](#documentation).
|
For more examples, see the [documentation](#documentation).
|
||||||
|
|
||||||
|
## Try it out now!
|
||||||
|
|
||||||
|
If you just want to try xrpl.js, you can fork this Code Sandbox template:
|
||||||
|
https://codesandbox.io/s/xrpl-intro-pxgdjr?file=/src/App.js
|
||||||
|
|
||||||
|
It goes through:
|
||||||
|
1. Creating a new test account
|
||||||
|
2. Sending a payment transaction
|
||||||
|
3. And sending requests to see your account balance
|
||||||
|
|
||||||
### Using xrpl.js with `create-react-app`
|
### Using xrpl.js with `create-react-app`
|
||||||
To use `xrpl.js` with React, you need to install shims for core NodeJS modules. Starting with version 5, Webpack stopped including shims by default, so you must modify your Webpack configuration to add the shims you need. Either you can eject your config and modify it, or you can use a library such as `react-app-rewired`. The example below uses `react-app-rewired`.
|
To use `xrpl.js` with React, you need to install shims for core NodeJS modules. Starting with version 5, Webpack stopped including shims by default, so you must modify your Webpack configuration to add the shims you need. Either you can eject your config and modify it, or you can use a library such as `react-app-rewired`. The example below uses `react-app-rewired`.
|
||||||
|
|
||||||
@@ -129,6 +139,9 @@ To use `xrpl.js` with React, you need to install shims for core NodeJS modules.
|
|||||||
"test": "react-app-rewired test",
|
"test": "react-app-rewired test",
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This online template uses these steps to run xrpl.js with React in the browser:
|
||||||
|
https://codesandbox.io/s/xrpl-intro-pxgdjr?file=/src/App.js
|
||||||
|
|
||||||
### Using xrpl.js with React Native
|
### Using xrpl.js with React Native
|
||||||
|
|
||||||
If you want to use `xrpl.js` with React Native you will need to install shims for core NodeJS modules. To help with this you can use a module like [rn-nodeify](https://github.com/tradle/rn-nodeify).
|
If you want to use `xrpl.js` with React Native you will need to install shims for core NodeJS modules. To help with this you can use a module like [rn-nodeify](https://github.com/tradle/rn-nodeify).
|
||||||
|
|||||||
Reference in New Issue
Block a user