Skip to content

Latest commit

 

History

History
34 lines (21 loc) · 1.15 KB

File metadata and controls

34 lines (21 loc) · 1.15 KB

@portabletext/react-native

Render Portable Text with React Native.

Uses @portabletext/react under the hood, and has the same API (except listNestingMode, which this package's PortableText does not accept), but renders React Native views instead of HTML.

Installation

npm install --save @portabletext/react-native

Basic usage

import {PortableText} from '@portabletext/react-native'

<PortableText
  value={[/* array of portable text blocks */]}
  components={/* optional object of custom components to use */}
/>

Styling the output

The rendered views has very little or no styling applied, so you will quite often want to pass custom components to override the built-in ones.

Customizing components

Customizing components are done in the same way as in @portabletext/react - see the README for more details.

License

MIT © Sanity.io