WebView bundled KaTeX
npm install react-native-katexReact Native library that uses WebView to render KaTeX mathematical expressions.
This approach enables the display of complex math formulas directly within React Native applications, facilitating their use in educational, scientific, and any other context where mathematical notation is required.
[![NPM version][npm-image]][npm-url]
[![Downloads][downloads-image]][npm-url]
[![Github CI Status][github-image]][github-url]
[EXPO Snack][expo-url]

javascript
const styles = StyleSheet.create({
katex: {
flex: 1,
}
});const inlineStyle =
;export default function App() {
const inlineText = 'inline text';
const [loaded, setLoaded] = useState(false);
const [expression, setExpression] = useState(
\\text{${inlineText} }c=\\pm\\sqrt{a^2 + b^2});
setTimeout(() => setExpression(\\text{${inlineText} }d=\\pm\\sqrt{a^2 + b^2}\\text{ still}), 2000); return (
expression={expression}
style={styles.katex}
inlineStyle={inlineStyle}
displayMode={false}
throwOnError={false}
errorColor="#f00"
macros={{}}
colorIsTextColor={false}
onLoad={() => setLoaded(true)}
onError={() => console.error('Error')}
/>
);
}
``[downloads-image]: https://img.shields.io/npm/dm/react-native-katex.svg
[npm-url]: https://www.npmjs.com/package/react-native-katex
[npm-image]: https://img.shields.io/npm/v/react-native-katex.svg
[github-url]: https://github.com/3axap4eHko/react-native-katex/actions/workflows/build.yml
[github-image]: https://github.com/3axap4eHko/react-native-katex/actions/workflows/build.yml/badge.svg
[expo-image]: https://raw.githubusercontent.com/3axap4eHko/react-native-katex/master/screenshot.png
[expo-url]: https://snack.expo.io/@3axap4ehko/react-native-katex