0.2.2 • Published 5 years ago

use-math v0.2.2

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

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.

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago