1.0.15 • Published 4 years ago

contentflare-react v1.0.15

Weekly downloads
11
License
ISC
Repository
github
Last release
4 years ago

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
1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago