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

how to handle with React.createElement ? #70

Open
shipcake opened this issue Mar 11, 2020 · 1 comment
Open

how to handle with React.createElement ? #70

shipcake opened this issue Mar 11, 2020 · 1 comment

Comments

@shipcake
Copy link

shipcake commented Mar 11, 2020

hi
I use transform and i dont get the value from html tag like.

const options = {
  transform: (node, index) => {
    if (node.name == "button") {
      return React.createElement(
        Button,
        null,
???? <-- how to insert value to this
      )
    }
  }
}
@MLNW
Copy link

MLNW commented Mar 23, 2020

I'm not 100% sure what you want to do but I'm guessing you want to add all children to this tag:

            const children = processNodes(node.children, transform);
            return React.createElement(Button, null, children);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants