@cmsdriven/react
v2.31.11
Published
No1 Headless and Decoupled CMS for react.js Progressive JavaScript Framework.
Downloads
56
Maintainers
Readme
CMS platform for react.js
You build components in React as you already do curently. Create new routes on the fly and manage how your components appearing in the screen on the fly.
Visit the website: cmsdriven.io
Note: There is an online chat support ready to help you with any question
Install the dependancies
npm i @cmsdriven/react --save
Use react components to display your content
On your root directory create a file named cmsdriven.js
.
In this one add the components you want to use with the cmsdriven.
You are going use the key name ComponentOne when you register the component to our online platform
import ComponentOne from './src/containers/componentOne'
import ComponentTwo from './src/containers/componentTwo'
export default {
ComponentOne: ComponentOne,
ComponentTwo: ComponentTwo
}
Dynamic Pages
React.js (CSR)
Into your router file include the following code
import { CmsDriven } from '@cmsdriven/react'
<main>
<Route exact path="/" component={Home} />
<Route exact path="*"
component={() => <CmsDriven accessToken={'YOUR_UNIQUE_TOKEN'} />}/>
</main>
Next.js (SSR)
Create a filename /pages/[cmsdrivenUrl]/index.js This will work as a catch all and drive all the routing that is not specify manually to our cmsdriven plugin then in this file add the following code
import React from 'react'
import { CmsDriven } from '@cmsdriven/react'
const CMS = () => {
return (
<div>
<CmsDriven accessToken={'YOUR_UNIQUE_TOKEN'} />
</div>
)
}
export default CMS
That's all! Now you can head to our online platform cmsdriven.io and register your components and create new pages.