@cloudcannon/react-connector
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -33,3 +33,3 @@ const React = require('react'); | ||
try { | ||
const latestValue = await CloudCannon.value(); | ||
const latestValue = await CloudCannon.value(options?.valueOptions); | ||
this.setState(latestValue); | ||
@@ -36,0 +36,0 @@ } catch(fetchError) { |
{ | ||
"name": "@cloudcannon/react-connector", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "A React connector for activating live visual editing in CloudCannon", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -40,2 +40,21 @@ # CloudCannon React Connector | ||
### CloudCannon options | ||
By default CloudCannon passes through processed markdown as HTML and new files as blobs. Both of these options are configurable | ||
using the `valueOptions` parameter. If you have a markdown processor built into your component set `keepMarkdownAsHTML` | ||
to false, this will prevent any double processing conflicts. | ||
``` | ||
import { CloudCannonConnect } from '@cloudcannon/react-connector' | ||
export default function App({ Component, pageProps }) { | ||
const AppComponent = CloudCannonConnect(Component, { | ||
valueOptions: { | ||
keepMarkdownAsHTML: false, | ||
preferBlobs: true | ||
} | ||
}); | ||
return <AppComponent {...pageProps}/> | ||
} | ||
``` | ||
### Modifying the props | ||
@@ -42,0 +61,0 @@ |
4770
76