mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-17 08:05:19 +00:00
cf958bacd1
* Start * Use MathJax v3 * Format * Improve font-size * Lint * Better handle loading * Copy MathJax assets to public folder * Attempt at using local assets for MathJax * Use bun 1.0.31 * Try with bun 1.0.33 * Try fixing headers * Simplify * Simplify and not use suspense module * Cleanup more * Add test for Math * Make math block scroll if needed * Update packages/react-math/src/KaTeX.tsx Co-authored-by: Greg Bergé <berge.greg@gmail.com> * Use React.use * Format * Use exports * Lint * Disable cache in CI for lint * Format --------- Co-authored-by: Greg Bergé <berge.greg@gmail.com>
18 lines
429 B
TypeScript
18 lines
429 B
TypeScript
'use client';
|
|
|
|
import React from 'react';
|
|
import type { MathJaXFormulaProps } from './MathJaX';
|
|
|
|
const MathJaXFormula = React.lazy(() => import('./MathJaX'));
|
|
|
|
/**
|
|
* Lazy component that loads MathJax and renders the formula.
|
|
*/
|
|
export function MathJaXLazy(props: MathJaXFormulaProps) {
|
|
return (
|
|
<React.Suspense fallback={props.fallback}>
|
|
<MathJaXFormula {...props} />
|
|
</React.Suspense>
|
|
);
|
|
}
|