【发布时间】:2022-01-26 00:52:47
【问题描述】:
每当我使用“mathjs”时都会收到此错误
TypeError: undefined is not an object (evalating '_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;
【问题讨论】:
标签: node.js reactjs react-native mathjs