Questions tagged [react-async]

Related to sync feature of React.js

Related to sync feature of React.js: https://reactjs.org/

https://reactjs.org/docs/getting-started.html

37 questions
18
votes
3 answers

React-Select Async loadOptions is not loading options properly

React Async Select loadoption sometimes fail to loads the option. This is a very strange phenomenon after couple of set of queries react loadoptions don't load any value but i can see from log that results properly came from backend query. My…
Shakil
  • 4,520
  • 3
  • 26
  • 36
11
votes
1 answer

Render a component from outside ReactJS

From here : "The only way to get a handle to a React Component instance outside of React is by storing the return value of React.render." I need to render a React component outside React and the reason for it I'm going to mention below. In my…
Istiaque Ahmed
  • 6,072
  • 24
  • 75
  • 141
5
votes
2 answers

React Redux - this.props.actions.fetchPosts is not a function

i have issue with calling async action from my component, i think i did everything what was needed to work but seems like not, i used: mapDispatchToProps and inside i return actions: bindActionCreators(fetchPosts, dispatch) and i connect…
Trusislv1
  • 193
  • 2
  • 4
  • 10
4
votes
1 answer

Dynamic Lazy Loading using React.Lazy (16.6.0)

I get an array like {Path:xxx, Component:"./xxx/ComPXX"} from my API and based on that create my application's routes. At the moment I'm using React-Loadable (5.5.0) and React-Router (4.4.0-betax to avoid warnings in strict mode). See working…
Asha
  • 3,871
  • 7
  • 44
  • 57
3
votes
1 answer

How to append data to a component with useAsync hook?

I am using react-async to fetch data from api like this: import {useAsync} from 'react-async' const getOrders = () => ... const MyComponent = () => { const { data, error, isLoading } = useAsync({ promiseFn: getOrders }) if (isLoading) return…
Neevai
  • 58
  • 7
3
votes
2 answers

Rendering part of a React function component after async call gets completed

I'm using material-ui with a React function component and using its Autocomplete component. I customized it and whenever I change the text in input field, I expect the component to render new search result. callAPI("xyz") I'm calling the API in the…
3
votes
2 answers

react.js change state of the topmost parent element from a deeply nested child

I am using react-async along with node.js. React-async is used to use react.js in the asynchronous way. To make ajax calls, I am using super-agent. The PostList Component is the topmost parent component. Through its setTopmostParentState method, the…
Istiaque Ahmed
  • 6,072
  • 24
  • 75
  • 141
2
votes
1 answer

How to define useAsync (react-async-hook) with TypeScript?

I am using react-async-hook for fetching API data in React component. const popularProducts = useAsync(fetchPopularProducts, []); fetchPopularProducts() is asynchronous method for making api call using fetch: export async function…
Denis2310
  • 939
  • 1
  • 15
  • 41
2
votes
2 answers

Async throws error in React Functional Component

I am trying to use use async in following functional component but throws error const RouteConfig = async ({ component: Component, fullLayout, user, auth, ...rest}) => ( { return ( …
Prashant Gupta
  • 153
  • 1
  • 2
  • 11
2
votes
1 answer

Maximum call stack size exceeded in react native

I am using react native and everything was working fine until I introduced following libs in package.json "babel-plugin-transform-class-properties": "^6.24.1", "babel-preset-es2015": "^6.24.1", "babel-preset-react": "^6.24.1", …
Adnan Ali
  • 2,890
  • 5
  • 29
  • 50
2
votes
1 answer

Getting rid of localhost:3000 URLs for ReactAsync

Cross-posted to https://github.com/andreypopp/react-async/issues/34 When using react-async is is common to have code which looks like: var UserPage = React.createClass({ mixins: [ReactAsync.Mixin], statics: { getUserInfo: function(username,…
fadedbee
  • 42,671
  • 44
  • 178
  • 308
1
vote
1 answer

Style for react-select-async-paginate

How can I implement style of react-select-async-paginate? Is it possible? import React, {useState} from 'react'; import {AsyncPaginate} from "react-select-async-paginate"; import {options as apiOptions, api_url} from "../../api/api.js"; const…
1
vote
0 answers

react lazy with async dynamic imports causes wrong orders in deployment

I'm using react, typescript. This is part of my code using react lazy. import {lazy} from 'react'; const LAZY_PANELS = {}; const PANELS = { 'home': () => import('./home'), 'settings': () => import('./settings'), 'profile': () =>…
SeyDal
  • 23
  • 4
1
vote
1 answer

Async React Select component how to change the argument of the loadOptions function

I have a react async select component. This component has a loadOptions props, where you need to pass a function to load data. At the moment it looks like this const MyComponent = () => { const [positionId, setPositionId] = useEffect(''); …
Max
  • 57
  • 1
  • 8
1
vote
1 answer

React-Async call run later with GET request on useFetch

I am trying to run a fetch request later by using useFetch from the React-Async library. I would like to run it in an effect hook. import React, {useEffect} from 'react'; import { useFetch } from "react-async" const Example = (props) => { const…
poiuytrez
  • 21,330
  • 35
  • 113
  • 172
1
2 3