Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@cloudcannon/react-connector
Advanced tools
Readme
Using a React based SSG? Want to see give your editors a live visual editing experience? Use the React Connector and connect CloudCannon.
npm i @cloudcannon/react-connector
Update the code in pages/_app.jsx
from:
export default function App({ Component, pageProps }) {
return <Component {...pageProps} />
}
to:
import { CloudCannonConnect } from '@cloudcannon/react-connector'
export default function App({ Component, pageProps }) {
const AppComponent = CloudCannonConnect(Component);
return <AppComponent {...pageProps}/>
}
In CloudCannon will now push through new page props from your editors updates.
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}/>
}
If your props are modified in the getStaticProps
function you can mirror those same operations. Below is an example of
the processProps
function which is passed the props before it is injected into the new props. This defaults to an identity
function which passes the props directly through.
import { CloudCannonConnect } from '@cloudcannon/react-connector'
export default function App({ Component, pageProps }) {
const AppComponent = CloudCannonConnect(Component, {
processProps: (props) => {
return props;
}
});
return <AppComponent {...pageProps}/>
}
FAQs
A React connector for activating live visual editing in CloudCannon
The npm package @cloudcannon/react-connector receives a total of 398 weekly downloads. As such, @cloudcannon/react-connector popularity was classified as not popular.
We found that @cloudcannon/react-connector demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.