Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rich-text-react-renderer] BLOCKS.DOCUMENT in options.renderNode is ignored #104

Closed
Simon-Tang opened this issue Jul 12, 2019 · 1 comment · Fixed by #109
Closed

[rich-text-react-renderer] BLOCKS.DOCUMENT in options.renderNode is ignored #104

Simon-Tang opened this issue Jul 12, 2019 · 1 comment · Fixed by #109
Labels
enhancement New feature or request

Comments

@Simon-Tang
Copy link
Contributor

Hi team,

The rich-text-react-renderer package is really cool! However I've noticed that although the README does list BLOCKS.DOCUMENT, this package doesn't allow the user to wrap the rendered output with an option like the following:

documentToReactComponents(
  json,
  {
    renderNode: {
      [BLOCKS.DOCUMENT]: (node, children) => (
        <CustomWrapper>{children}</CustomWrapper>
      ),
    },
  },
);

Maybe we could add this functionality by passing the root node itself into nodeToReactComponent?

@sbezludny
Copy link
Contributor

Sounds good to me, feel free to open a PR :)

@sbezludny sbezludny added the enhancement New feature or request label Jul 23, 2019
Simon-Tang added a commit to Simon-Tang/rich-text that referenced this issue Jul 29, 2019
Enables the option renderNode[BLOCKS.DOCUMENT] with
rich-text-react-renderer, defaulting to current Array output.

✅ Closes: contentful#104
sbezludny pushed a commit that referenced this issue Aug 1, 2019
Enables the option renderNode[BLOCKS.DOCUMENT] with
rich-text-react-renderer, defaulting to current Array output.

✅ Closes: #104
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants