小编Yoe*_*oel的帖子

从 react-router-dom 属性“sumParams”升级版本 4 useParams() 后 TypeScript 错误在类型“{}”上不存在

从 react-router-dom 升级到 useParams () 中使用的版本 4 后,出现 typeScript 错误

"typescript": "^4.0.2"

import { useParams } from 'react-router-dom';

const { sumParams } = useParams();

Run Code Online (Sandbox Code Playgroud)
Property 'sumParams' does not exist on type '{}'. 
Run Code Online (Sandbox Code Playgroud)

该项目运行良好,只有在升级后才会引发错误

javascript typescript reactjs react-dom react-router-dom

52
推荐指数
3
解决办法
1万
查看次数

“Stack.Navigator”不能用作 JSX 组件

使用反应导航时存在类型问题,当使用Stack.NavigationStack.Group来自createNativeStackNavigator

该问题表示JSX.element消息末尾的类型不匹配更具体: Type '{}' is not assignable to type 'ReactNode'

整个消息:

'Stack.Navigator' cannot be used as a JSX component.
  Its element type 'ReactElement<any, any> | Component<Omit<DefaultRouterOptions<string> & { id?: string | undefined; children: ReactNode; screenListeners?: Partial<...> | ... 1 more ... | undefined; screenOptions?: NativeStackNavigationOptions | ... 1 more ... | undefined; defaultScreenOptions?: NativeStackNavigationOptions | ... 1 mo...' is not a valid JSX element.
    Type 'Component<Omit<DefaultRouterOptions<string> & { id?: string | undefined; children: …
Run Code Online (Sandbox Code Playgroud)

typescript react-native react-navigation expo react-navigation-v6

42
推荐指数
3
解决办法
2万
查看次数

materiel-ui中的Box和Grid有什么区别

Material-UI中BoxGrid的区别是什么

何时使用每个

我对此感到困惑

css reactjs material-ui

17
推荐指数
3
解决办法
4156
查看次数

如何解决“动画:不支持`useNativeDriver`,因为缺少本机动画模块。” 在反应导航?

我正在开发 expo SDK 版本:36 和所有平台 (ios/android/web)

react-navigation按照文档中的描述第一次安装并运行 jest --watch 时,出现以下警告:

    console.warn node_modules/react-native/Libraries/YellowBox/YellowBox.js:71
      Animated: `useNativeDriver` is not supported because the native animated module is missing. Falling back to JS-based animation. To resolve this, add `RCTAnimation` module to this app, or remove `useNativeDriver`. More info: https://github.com/facebook/react-native/issues/11094#issuecomment-263240420
Run Code Online (Sandbox Code Playgroud)

它也发生在浏览器控制台中:

bundle.js:18272 Animated: `useNativeDriver` is not supported because the native animated module is missing. Falling back to JS-based animation. To resolve this, add `RCTAnimation` module to this app, or remove `useNativeDriver`. More …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs jestjs react-native react-navigation

16
推荐指数
2
解决办法
9947
查看次数

无法识别的事件 React Native Redux

我是 redux 的新手。我正在将 redux 与 react-native 结合使用。我刚刚创建了一个简单的应用程序,它在 redux 上存储了 RGB 颜色,并且我正在使用和更新组件的状态。输出很好,但我的 cmd 窗口出现错误。我正在使用 Expo-CLI。 在此处输入图片说明

我的应用程序代码在这里 App.js

import React from 'react';
import { View } from 'react-native';
import reducer from './src/reducers/Index'
import {Provider} from 'react-redux'
import {createStore} from 'redux'
import ColorTile from './src/component/ColorTile.js'
const store=createStore(reducer)
export default function App() {
  return (
    <Provider store={store}>
      <View style={{flex:1,justifyContent:"center",alignItems:'center'}}>
          <ColorTile />
      </View>
    </Provider> 
  );
}
Run Code Online (Sandbox Code Playgroud)

Index.js 代码

import {combineReducers} from 'redux'
import rgbReducer from './rgbReducer'

const allReducer=combineReducers({
      rgb:rgbReducer
})
export default allReducer

export …
Run Code Online (Sandbox Code Playgroud)

reactjs react-native react-redux react-native-android expo

6
推荐指数
1
解决办法
4046
查看次数

如何画一个有n个切片的圆

我正在使用 react-native-svg 模块,我想画一个分成 n 个切片的圆。我的圆半径是 41,它的中心是 (50, 50) 例如对于 n=6 我想画这样的东西:

有 5 个切片的圆圈

javascript reactjs react-native react-native-svg

4
推荐指数
1
解决办法
917
查看次数