Reactium + REST
The foundational web app framework Reactium can be used with our Actinium API or with and client-side API of your choosing.
Creating a simple API
Use axios, native fetch, or a library of your choosing, in some API domain folder of your choice, generate a new reactium-hooks.js
file.
reactium-hooks.js (version 1)
Register your API
The above is incomplete. In order to make this API available to the rest of your app, let's register it.
reactium-hooks.js (version 2)
Now that we've registered our REST API with the Reactium SDK, we can use it throughout out app as Reactium.helloAPI
. Congrats! You just extended the Reactium SDK with your own API!
Use your API
Let's say we want to surface our /hello
API endpoint in a React component. We can now access our helloAPI
on the Reactium SDK directly.
src/app/components/Hello/MyHelloComponent.js
Last updated