我尝试在react-native中使用Navigation ..我添加了: npm install --save react-navigation
但是它给我这样的错误:
错误:捆绑失败:错误:无法解析模块react-native-gesture-handler从C:\reactnative\proejectName\node_modules\@react-navigation\native\src\Scrollables.js:模块react-native-gesture-handler不会在急速模块地图存在
这是索引:
import { AppRegistry } from 'react-native';
import App from './App';
import { name as appName } from './app.json';
AppRegistry.registerComponent(appName, () => App);
Run Code Online (Sandbox Code Playgroud)
这是app.js
import React from 'react';
import { createStackNavigator, createAppContainer, } from 'react-navigation';
import First from './src/Components/First';
import DescriptionPage from './src/Components/DescriptionPage';
const Navigation = createStackNavigator({
First: {
screen: First,
},
DescriptionPage: {
screen: DescriptionPage,
},
});
const App = createAppContainer(Navigation);
export default App;
Run Code Online (Sandbox Code Playgroud)
这是package.json: …
我尝试获取apk应用程序。我做得很好。但是,我今天尝试使用get apk的其他应用程序,但它没有给我发布apk。为什么呢?
我遵循了以下步骤: 在此处输入链接描述
通常,它需要2-3分钟,但现在仅持续3秒,并且不会生成APK
它说:
此构建中使用了不推荐使用的Gradle功能,使其与Gradle 6.0不兼容。使用“ --warning-mode all”来显示各个弃用警告。参见 https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
我尝试获取 TextInput 的值
使用引用
但它给出了未定义的。这是我的代码:
const inputRef = useRef(null);
<TextInput
ref={inputRef}
value={'test'}
editable={false}
style={styles.InputStyle}
/>
console.log(inputRef.current.value) ---> gives undefined
Run Code Online (Sandbox Code Playgroud) 我尝试使用 redux,但我收到了这个错误。
我这样使用:
import React, { Component } from 'react';
import { connect } from 'react-redux';
class LibraryList extends Component {
render() {
return null;
}
}
const mapStateToProps = state => {
console.log(state);
};
export default connect(mapStateToProps)(LibraryList);
Run Code Online (Sandbox Code Playgroud)
但这给了我一个错误。我该怎么办。有人可以帮忙吗?
这是我的 app.js
import React, { Component } from 'react';
import { Platform, StyleSheet, Text, View, FlatList } from 'react-native';
import { Provider } from 'react-redux';
import { createStore } from 'redux';
import reducers from './src/reducers';
import LibraryList from './src/components/LibraryList';
const App …Run Code Online (Sandbox Code Playgroud)