How to use types mentioned inside react native inside react-native-web app ? #2685
Unanswered
archana-iron
asked this question in
Help
Replies: 4 comments
|
Please suggest, I did not find any sample where you are using types inside this package, please suggest. |
0 replies
|
Yes please suggest something because I'm facing the same issue and not getting any solution for it. |
0 replies
|
Same issue is occuring in my project also, and i'm unable to find any solution for it, please suggest something. |
0 replies
|
It would be helpful if you could suggest something similar to me because I have similar issues in my own project as well. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Is there an existing request?
Describe the feature request
I am building a react js web custom component package where I have to show the preview of my mobile components. So I created a react native components package and later added a clone copy of the package for the react native web app also by using an alias. Now, the problem is I am not able to use the types used inside react native component inside the react native component package.
Example:
import React, { memo } from 'react';
import { View as NativeView, type ViewStyle } from 'react-native-web';
export interface ViewProps {
children?: React.ReactNode;
style?: {
style?: ViewStyle;
};
}
function View({ children = null, style = {}, ...rest }: ViewProps) {
return (
<NativeView style={style?.style} {...rest}>
{children}
);
}
View.displayName = 'View';
export default memo(View);
Getting error: Unsafe type declaration for 'any', inside <NativeView style={style?.style} {...rest}>, for style?.style. Please suggest how I can use react native types inside the react native web package.
Can we use react native types inside the react native web app or custom package where we have used react native web? If yes, please suggest how.
All reactions