Editmode for React Native
Editmode is a CMS for your mobile app copy.
Installation
Use npm to install Editmode:
Usage
Step 1: Import the Editmode wrapper and wrap your App within it
Step 1a (Optional): Create an Editmode account on Editmode.com and create/import your content
👉 Editmode Sign Up 👈
Rendering content inside your app
In order to render app copy, you'll need to wrap it in the <Chunk />
component.
The most basic way to render content is to pass in the identifier of your chunk on the Editmode platform.
For better readability, you can opt to pass in the content key of your chunk on the Editmode platform.
Use variables to personalize and interpolate the content you're showing.
Fallbacks
As you may have inferred, the above examples rely on the Editmode API to serve content. This carries speed and uptime considerations. To address this, you may also specify your own fallback content, in a number of ways.
Using a resource file
Want to automate your tooling or workflow and generate your resource file programatically? You can use the content returned from the GET Chunks API endpoint.
Specifying default content inline
Adding custom width and height to images
By default every image rendered using Editmode is sized 50px in height and 50px in width. You can override those sizes by passing imageHeight
and imageWidth
as props.
Sizes passed through imageHeight
and imageWidth
are in pixels.
Trigger Cache Expire
You may want to refresh all your contents to make sure your user see the right contents in your app. You can use the refreshChunks
function to force update your local storage with the recent version of your contents from Editmode Content Hub.
Example:
Live Demo:
Render Content Flow
Last updated