admin管理员组

文章数量:1022853

How to avoid the this kind of warning?
My app is working but it gives warning in terminal like below

Compiled with warnings.
/home/karim/Desktop/React-Native/RN-Complete-Guide/node_modules/react-navigation-header- 
buttons/src/overflowMenuPressHandlers.js
Attempted import error: 'ActionSheetIOS' is not exported from 'react-native-web/dist/index'.

It is because of of I imported HeaderButtons and HeaderButton from react-navigation-header-buttons like below

import { HeaderButtons } from "react-navigation-header-buttons";
import { HeaderButton } from "react-navigation-header-buttons";

And I am using react-native 4.x veriosn.
is there any way to avoid this warning?

How to avoid the this kind of warning?
My app is working but it gives warning in terminal like below

Compiled with warnings.
/home/karim/Desktop/React-Native/RN-Complete-Guide/node_modules/react-navigation-header- 
buttons/src/overflowMenuPressHandlers.js
Attempted import error: 'ActionSheetIOS' is not exported from 'react-native-web/dist/index'.

It is because of of I imported HeaderButtons and HeaderButton from react-navigation-header-buttons like below

import { HeaderButtons } from "react-navigation-header-buttons";
import { HeaderButton } from "react-navigation-header-buttons";

And I am using react-native 4.x veriosn.
is there any way to avoid this warning?

Share Improve this question edited May 27, 2021 at 9:42 Karim asked May 8, 2021 at 16:55 KarimKarim 4101 gold badge5 silver badges15 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 2

This file in the source for react-navigation-header-buttons imports ActionSheetIOS, which is not supported by React Native web applications. This seems like it's probably an issue with React Native web itself, as even importing the ActionSheetIOS ponent in your project without actually using it will cause a crash from my past experience.

You probably won't be able to use react-navigation-header-buttons for your solution because of this issue. The authors also go on to say in their README that web support is currently experimental:

Supports iOS and Android, web support is experimental.

I'd suggesting either finding a way to avoid this library or flag an issue on the repo to suggest swapping ActionSheetIOS in with a cross-platform action sheet solution like react-native-action-sheet.

in react-native-web/dist/index.js i exported export { ActionSheetIOS }; and somehow the warning disappeared

How to avoid the this kind of warning?
My app is working but it gives warning in terminal like below

Compiled with warnings.
/home/karim/Desktop/React-Native/RN-Complete-Guide/node_modules/react-navigation-header- 
buttons/src/overflowMenuPressHandlers.js
Attempted import error: 'ActionSheetIOS' is not exported from 'react-native-web/dist/index'.

It is because of of I imported HeaderButtons and HeaderButton from react-navigation-header-buttons like below

import { HeaderButtons } from "react-navigation-header-buttons";
import { HeaderButton } from "react-navigation-header-buttons";

And I am using react-native 4.x veriosn.
is there any way to avoid this warning?

How to avoid the this kind of warning?
My app is working but it gives warning in terminal like below

Compiled with warnings.
/home/karim/Desktop/React-Native/RN-Complete-Guide/node_modules/react-navigation-header- 
buttons/src/overflowMenuPressHandlers.js
Attempted import error: 'ActionSheetIOS' is not exported from 'react-native-web/dist/index'.

It is because of of I imported HeaderButtons and HeaderButton from react-navigation-header-buttons like below

import { HeaderButtons } from "react-navigation-header-buttons";
import { HeaderButton } from "react-navigation-header-buttons";

And I am using react-native 4.x veriosn.
is there any way to avoid this warning?

Share Improve this question edited May 27, 2021 at 9:42 Karim asked May 8, 2021 at 16:55 KarimKarim 4101 gold badge5 silver badges15 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 2

This file in the source for react-navigation-header-buttons imports ActionSheetIOS, which is not supported by React Native web applications. This seems like it's probably an issue with React Native web itself, as even importing the ActionSheetIOS ponent in your project without actually using it will cause a crash from my past experience.

You probably won't be able to use react-navigation-header-buttons for your solution because of this issue. The authors also go on to say in their README that web support is currently experimental:

Supports iOS and Android, web support is experimental.

I'd suggesting either finding a way to avoid this library or flag an issue on the repo to suggest swapping ActionSheetIOS in with a cross-platform action sheet solution like react-native-action-sheet.

in react-native-web/dist/index.js i exported export { ActionSheetIOS }; and somehow the warning disappeared

本文标签: javascript39ActionSheetIOS39 is not exported from 39reactnativewebdistindex39Stack Overflow