mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
* [rehype-react] Add Fragment option Usually this will be `React.Fragment`, but it accepts any component. * [rehype-react] Update which options are optional Most options have healthy defaults. Only `createElement` is required. * [rehype-react] Update version number * [rehype-react] Update tests to include Fragment option
20 lines
363 B
TypeScript
20 lines
363 B
TypeScript
import React from "react";
|
|
import RehypeReact from "rehype-react";
|
|
|
|
const htmlAst = {
|
|
type: "element",
|
|
tagName: "button"
|
|
};
|
|
|
|
const { Compiler: compile } = new RehypeReact({
|
|
createElement: React.createElement,
|
|
Fragment: React.Fragment,
|
|
components: {
|
|
button: () => {
|
|
return <button />;
|
|
}
|
|
}
|
|
});
|
|
|
|
compile(htmlAst);
|