我正在从Even Bacon运行一个ansicolor
聊天应用示例,并遇到import 'package:ansicolor/ansicolor.dart';
main(List<String> arguments) {
AnsiPen greenPen = AnsiPen()..green();
AnsiPen greenBackGroundPen = AnsiPen()..green(bg: true);
AnsiPen redTextBlueBackgroundPen = AnsiPen()..blue(bg: true)..red();
AnsiPen boldPen = AnsiPen()..white(bold: true);
AnsiPen someColorPen = AnsiPen()..rgb(r: .5, g: .2, b: .4);
print(greenPen("Hulk") + " " + greenBackGroundPen("SMASH!!!"));
print(redTextBlueBackgroundPen("Spider-Man!!!") + " " + boldPen("Far From Home!!!"));
print(someColorPen("Chameleon"));
}
错误:
这是package.json:
react-native
关于不同情况下的错误,有一些在线帖子。错误指向Chat.js中的frame out of range NaN
。而且我不知道是什么原因导致了错误。
"firebase": "^5.8.0",
"react": "16.6.3",
"react-native": "0.57.8",
"react-native-elements": "^0.19.1",
"react-native-gesture-handler": "^1.0.15",
"react-native-gifted-chat": "^0.7.0",
"react-navigation": "^3.0.9"
答案 0 :(得分:1)
错误似乎是在您的消息初始状态。
您已将状态定义为
state = {
messages: {}
}
消息应定义为数组,因此将初始状态更新为
state = {
messages: []
}
从文档中
- 消息(数组)-显示的消息