-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
I'm not quite sure how to classify this bug - I've never seen something like it before! React mathquill behaves differently depending on where it receives variables from - see below:
import React, { useState } from 'react';
import { EditableMathField } from 'react-mathquill';
interface IEditableMathQuill {
start_value: string
}
const inner_start_value = "\\frac{1}{\\sqrt{2}}\\cdot 2";
export const EditableMathQuill = (props: IEditableMathQuill) => {
console.log(props.start_value, inner_start_value);
const [latex, setLatex] = useState(props.start_value);
return (
<div>
<EditableMathField
className='mq-editable-field'
latex={latex}
onChange={(mathField) => {
setLatex(mathField.latex());
}}
/>
<p>{latex}</p>
</div>
);
};Using props.start_value (a variable from outside the file), it fails to render, but using "inner_start_value" it succeeds. The console log returns they both have the same value.
Thanks!
Metadata
Metadata
Assignees
Labels
No labels