Q
Q
Quintis2021-11-29 13:44:05
Android
Quintis, 2021-11-29 13:44:05

callback in react native?

There is a basic module CalendarModule which is made according to the documentation https://reactnative.dev/docs/native-modules-android , in order to return a string from the module I use the following code:

@ReactMethod
    public String returnString(Callback callback) {
        callback.invoke("string111");
    }


but when I build I get an error
CalendarModule.java:29: error: cannot find symbol Callback

i.e. java cannot find the callback interface, tell me what to do to make it work

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Makarov, 2022-01-17
@kirbi1996

Import may be missing some

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question