尝试分配给只读属性错误

时间:2020-05-18 15:27:40

标签: javascript react-native stack react-navigation react-navigation-drawer

我试图将堆栈导航嵌套在抽屉式导航中,并且得到

Device: (895:881) Attempted to assign to readonly property.
Evaluating module://react-native-screens.js
Evaluating module://react-navigation-drawer.js
Evaluating module://routes/drawer.js.js
Evaluating module://App.js.js
Loading module://App.js

抽屉将嵌套两个堆栈导航器。 homeStack和抽屉堆栈。抽屉是App.js中导出的​​。有人可以解释我在做什么错吗?

Drawer.js

import * as React from 'react';
import { createDrawerNavigator } from 'react-navigation-drawer';
import { createAppContainer } from 'react-navigation';

import HomeStack from './homeStack';
import DrawerStack from './drawerStack';

const screens = {

  Home: {
  screen: HomeStack,
},
  About: {
  screen: DrawerStack,
}}

const Drawer = createDrawerNavigator(screens);
export default Drawer;

App.js

import * as React from 'react';

import Drawer from './routes/drawer'

export default class App extends React.Component {
  render() {
  return (
      <Drawer /> 
);
}
}

0 个答案:

没有答案