Skip to content

Commit

Permalink
Example code that breaks use of promise in native module code
Browse files Browse the repository at this point in the history
'promise.resolve' in included native module will never resolve after adding call to Storybook (tested on Android)
  • Loading branch information
4lun committed Apr 26, 2021
1 parent 52953dc commit b6c287b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import React, {useEffect, useState} from 'react';
import {SafeAreaView, StyleSheet, Text} from 'react-native';
import AwesomeModule from 'react-native-awesome-module';

import {getStorybookUI} from '@storybook/react-native';
getStorybookUI({});

const App = () => {
const [result, setResult] = useState(0);

Expand Down

1 comment on commit b6c287b

@4lun
Copy link
Owner Author

@4lun 4lun commented on b6c287b Apr 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After applying this change, the promise never resolves. Removing it (and rebuilding the app) fixes it.

Before Change After Change
)

The code in question: https://github.com/4lun/react-native-awesome-module/blob/eb033343f242cccfe604fcdee308227a751d2efe/android/src/main/java/com/reactnativeawesomemodule/AwesomeModuleModule.kt#L16-L21

Please sign in to comment.