I get this error whenever I use 'mathjs'
TypeError: undefined is not an object (evaluating '_mathjs.default.fraction')
Basically my code is this
import React from 'react';
import {View, Button} from 'react-native';
import mathjs from 'mathjs';
const App = () => {
return (
<View>
<Button
title="TestButton"
onPress={() => {
console.log(mathjs.fraction(1, 2)); // equals to ½
}}
/>
</View>
);
};
export default App;