Skip to content

mDibyo/use-math

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

useMath

React hook for auto-rendering math content in the specified react node.

screenshot

function MathDiv({ children }) {
  const ref = React.createRef();
  useMath(ref);

  return <div ref={ref}>{children}</div>;
}

ReactDOM.render(
  <MathDiv>{"Math here: $$x = \\frac{1}{2}$$"}</MathDiv>,
  document.getElementById('root'),
);

Usage

npm install use-math

Then import

import useMath from 'use-math';

Introduction

Under the hood, useMath uses KaTeX to render the math content.

About

React hook for auto-rendering math content in the specified react node

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published