JiLiZART/BBob

Implement render function in React preset

JiLiZART opened this issue · 1 comments

Add ability to pass render and render bbcodes to react in react preset

Would it gives the ability to render some of the tags with our own homemade react components?

Because it would be exactly what I'm looking for.

EDIT: Nevermind...

It seems I can already do that by providing my custom component to the tag key

reactPreset.extend((tags, options) => ({
  ...tags,
  mytag: (node) => ({
    tag:   MyTagHandler,
    attrs: {
      tagContent: node.content[0],
    },
  }),
}));