Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

ShaMan123/react-math-view

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e68412c · Jul 28, 2022

History

70 Commits
Jul 28, 2022
Sep 24, 2021
Sep 24, 2021
Dec 20, 2020
Dec 20, 2020
Dec 20, 2020
Dec 20, 2020
Dec 20, 2020
Dec 20, 2020
Jan 16, 2022
Sep 24, 2021
Sep 24, 2021
Dec 20, 2020
Sep 24, 2021

Repository files navigation

react-math-view

React bindings for MathLive

NPM JavaScript Style Guide

Install

npm install --save react-math-view
yarn add react-math-view

Usage

import { useRef } from 'react';
import MathView, { MathViewRef } from 'react-math-view';

const ref = useRef<MathViewRef>(null);
const toggleKeyboard = useCallback(() => ref.current?.executeCommand('toggleVirtualKeyboard'), [ref]);
const getSpokenValue = useCallback(() => ref.current?.getValue('spoken'), [ref]);
<MathView
 value="x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}"
 ref={ref}
  />

Looking for React-Native?

Check out react-native-math-view.

Other Options

react-mathlive

Dev

Before you begin make sure to install dependecies

Don't forget to do the same in /example before running it

npm i && npm i --only=dev /* or */ yarn --production=false

Available commands

// start dev servers for /src and /example
npm run dev

// publish to npm
npm run publish

// deploy gh-pages (example app)
npm run deploy

License

MIT © ShaMan123