Skip to content

What should the arguments of a custom component be? #92

Answered by ChristianMurphy
re-taro asked this question in Q&A
Discussion options

You must be logged in to vote

@re-taro could you share an example of what type of error you are seeing?
Trying out minimal example rehype-react with <p> replaced by Chakra's <Text> element appears to work in both JS and TS as expected.
https://codesandbox.io/s/rehype-react-with-chakra-hswxdo?file=/src/index.tsx

code example
import React, {
  createElement,
  ReactElement,
  Fragment,
  useEffect,
  useState
} from "react";
import { render } from "react-dom";
import { unified } from "unified";
import rehypeParse from "rehype-parse";
import rehypeReact from "rehype-react";
import { ChakraProvider, Text } from "@chakra-ui/react";

const text = `<h2>Hello, world!</h2>
<p>Welcome to my page 👀</p>`;

function useProcessor(t…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@re-taro
Comment options

@re-taro
Comment options

@ChristianMurphy
Comment options

@wooorm
Comment options

@re-taro
Comment options

Answer selected by re-taro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants