React component wrapper for Mathquill
npm install @numberworks/react-mathquill
- Build of examples located at src/examples/
- Play with the examples below at this Code Sandbox
``javascript
import React, { useState } from 'react'
import { addStyles, EditableMathField } from 'react-mathquill'
// inserts the required css to the
block.const EditableMathExample = () => {
const [latex, setLatex] = useState('\\frac{1}{\\sqrt{2}}\\cdot 2')
return (
{latex}
$3
`javascript
import React from 'react'
import { addStyles, StaticMathField } from 'react-mathquill'// inserts the required css to the
block.
// you can skip this, if you want to do that by yourself.
addStyles()const StaticMathExample = () => (
{'\\frac{1}{\\sqrt{2}}\\cdot 2'}
)
`Documentation
addStyles (function)
This function, when called, will append a