每当我使用“mathjs”时,我都会收到此错误
TypeError:未定义不是对象(评估'_mathjs.default.fraction')
基本上我的代码是这样的
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;