Skip to content

Commit cbdfe8d

Browse files
Update Readme to resolve TS error solution (#167)
* Update README.md * Create clever-radios-destroy.md * Update README.md --------- Co-authored-by: Cody Olsen <81981+stipsan@users.noreply.github.com>
1 parent e319f6a commit cbdfe8d

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@portabletext/react": patch
3+
---
4+
5+
Update Readme to include TS imports

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,11 @@ const components: PortableTextComponents = {
172172

173173
An object of React components that renders portable text blocks with different `style` properties. The object has the shape `{styleName: ReactComponent}`, where `styleName` is the value set in individual `style` attributes on blocks (`normal` being the default).
174174

175-
```jsx
175+
```tsx
176+
import { PortableText, PortableTextReactComponents } from "@portabletext/react";
177+
176178
// `components` object you'll pass to PortableText
177-
const components = {
179+
const components:Partial<PortableTextReactComponents> = {
178180
block: {
179181
// Ex. 1: customizing common block types
180182
h1: ({children}) => <h1 className="text-2xl">{children}</h1>,

0 commit comments

Comments
 (0)