1.0.15 • Published 4 years ago
contentflare-react v1.0.15
contentflare-react
React client for Content Flare - contentflare.io
Installation
npm i contenflare-react
Implementation
import React, { useState } from 'react'
import { Helmet } from 'react-helmet'
import { Page, Config } from 'contentflare-react'
Config.init({
organization: 'ORGANIZATION_SLUG',
publicKey: 'PUBLIC_API_KEY',
error404: 'ROUTE_404_PAGE_IN_CONTENTFLARE',
})
const App = () => {
const [title, setTitle] = useState('')
const [description, setDescription] = useState('')
return (
<>
<Helmet>
<title>{title}</title>
<meta name="description" content={description} />
</Helmet>
<Page
pathname="/about-us"
onChange={(error, { title, description, properties}) => {
if (!error) {
setTitle(title)
setDescription(description)
}
}}
/>
</>
)
}
export default App