Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
type Template<T> = (args: T) => string;
export function makeJadeTransitionShim<T>(jadeTemplate: Template<T>, Component: React.ComponentType<T>): Template<T> {
return (args: T) => {
const jadeResult = jadeTemplate(args);
const reactResult = ReactDOMServer.renderToStaticMarkup(<Component {...args} />);
assert(jadeResult === reactResult, 'Results not equal!');
return jadeResult;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment