Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
@prezly/content-renderer-react-js
Advanced tools
Render Prezly Content Format documents used at Prezly.
npm install --save @prezly/content-renderer-react-js
Make sure all peer dependencies are met (react
, react-dom
).
npm install --save react react-dom
npm install --save-dev @types/react @types/react-dom
If you need to support older browsers, you can use this polyfill for object-fit
: https://github.com/fregante/object-fit-images. This package already includes necessary syntax to work with the polyfill - all you have to do is include the polyfill.
<script src="//cdnjs.cloudflare.com/ajax/libs/object-fit-images/3.2.4/ofi.min.js"></script>
<script>
objectFitImages();
</script>
import React from 'react';
import { DOCUMENT_NODE_TYPE, HEADING_1_NODE_TYPE, DocumentNode } from '@prezly/slate-types';
import { Renderer } from '@prezly/slate-renderer';
const documentNode: DocumentNode = {
children: [
{
children: [{ text: 'Hello world!' }],
type: HEADING_1_NODE_TYPE,
},
],
type: DOCUMENT_NODE_TYPE,
version: '0.50',
};
const MyComponent = () => (
<Renderer
nodes={documentNode} /* or nodes={[documentNode]}, up to you */
options={{
/* override default heading render */
[HEADING_1_NODE_TYPE]: ({ children, className, node, ...props }) => (
<div className={className} style={{ color: 'red' }}>
{children}
</div>
),
}}
/>
);
export default MyComponent;
Brought to you by Prezly.
FAQs
Render Prezly Content Format documents with React.js
We found that @prezly/content-renderer-react-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.