-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
not getting suggestions when used this library with class component #17
Comments
Did you try something like this?
|
import * as React from 'react'; const users = [ const renderSuggestions1: (suggestions: Suggestion[]) => FC = (suggestions) => ( if (keyword == null || keyword.length<3) {
} }; class App extends Component { constructor(props){ render(){ export default App; I tried in this mannner |
@HTEN1998 I see on your code |
sorry that was a typing mistake, but in code, I was using it as renderSuggestions, can u tell if I m doing that in correct way? |
It looks like it should work. What error are you getting? Where |
I m not getting any error, users variable is defined as a global variable at the top. const users = [ |
Ok, first of all, it shouldn't appear until you will type at least 3 characters due to the |
@HTEN1998, do you have any other questions? |
Yes, currently I m getting suggestions from this library, but I need to make an API call if keyword.length < 3. But before the API call gets finishes, the return statement gets executed I am trying in this way:const users = []; const renderSuggestions: (suggestions: Suggestion[]) => FC = (suggestions) => ( if (keyword == null || keyword.length<3) { apiCallingFunction();
} }; and I m using Axios library |
You can investigate React hooks, especially
|
@HTEN1998 do you have some good news on that? |
@dabakovich sorry for delayed response, your suggestion worked for me. Thanks a lot |
Great, going to close the ticket. Feel free to re-open it if you will get any other questions. |
@dabakovich I try this and generate warning in development:
|
@dabakovich @ricardopacheco @HTEN1998 are you guys solve this issue with class component? |
`
` |
I am using "react-native": "0.61.5" and when I used this library with class component RenderSuggestions is not getting called.
Can u give me an example of how to use this library with class component
The text was updated successfully, but these errors were encountered: