Giter Site home page Giter Site logo

Comments (5)

vivek12345 avatar vivek12345 commented on July 20, 2024 1

@fjacobs the response is always returned to the onSuccess handler so you can use that and then set your own local component state. For example in a twitter feed example you can have a local component with this.state = { feeds: [] } and on every polling success you might append the new tweets to this feed.

I hope that answers your question.

from react-polling.

vivek12345 avatar vivek12345 commented on July 20, 2024

@K3CK Thank you for the kind words and sorry to see it not working as expected.
Can you try with the latest release v1.0.5?
That should fix your issue and startPolling, stopPolling should work as expected.

Let me know if you still face any issues.

from react-polling.

K3CK avatar K3CK commented on July 20, 2024

Thanks for your fast response. But unfortunately it throws now a different error:

Warning: Cannot update during an existing state transition (such as within render). Render methods should be a pure function of props and state.
And
Uncaught Invariant Violation: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.

from react-polling.

vivek12345 avatar vivek12345 commented on July 20, 2024

can you create a codesandbox link for me to check?

from react-polling.

fjacobs avatar fjacobs commented on July 20, 2024

I have a stupid question: I was wondering how do I get the body of the response in your example:

if(isPolling) {
                            return (
                                <div> Returned json: ? </div>
                            );
                        } else {
                            return (
                                <div> Hello I stopped polling</div>
                            );
                        }

from react-polling.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.