This repository has been archived by the owner on Apr 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
How to serialize list in block #33
Comments
@ghoshanjega I was facing the same issue. After spending some time found out that the
|
Thanks for this. I also wanted to distinguish between ordered and unordered lists, this is how I did it, maybe it can be improved: list: (props) => {
const { type } = props;
const bullet = type === 'bullet';
if (bullet) {
return <ul>{props.children}</ul>;
}
return <ol>{props.children}</ol>;
},
listItem: (props) => <li>{props.children}</li> |
Thanks for the reply regarding "list" and "listItem". Faced the same question. Searched for this in the docs to no avail. Would be nice to mention this somewhere because i think most of us try to style it in the block type..... :-) |
Thanks for raising this! We've improved the API of list/listItem overrides in the new @portabletext/react module - hopefully it should be easier to customize. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I cannot seem to figure out how to serialize for lists in block
Example ul block as _rawBody.
This is my serializer.
The text was updated successfully, but these errors were encountered: