Giter Club home page Giter Club logo

Comments (5)

jackyef avatar jackyef commented on May 24, 2024 2

Hi @juanpablocs! Since hooks can only be used inside a function component, for class component you can use the HOC withData() or withLazyData() instead.

An example of how to use it can be seen in the docs: https://react-isomorphic-data.netlify.com/docs/hocs/withdata

Please let me know if the docs are unclear, so I can help you and improve the docs as well.

from react-isomorphic-data.

juanpablocs avatar juanpablocs commented on May 24, 2024

Your project is interesting, congratulations. Could you support axios please?

from react-isomorphic-data.

juanpablocs avatar juanpablocs commented on May 24, 2024

I'm testing on my project and it doesn't work 😢

import React from 'react';
import { withData } from 'react-isomorphic-data';

class Category extends React.Component {
    render() {
        console.log(this.props.categories);
        return <p>Category</p>;
    }
}

const CategoryHoc = withData({
    url: `${API_BASE}/categories`,
    name: 'categories'
})(Category);

export { CategoryHoc as Category };

Screenshot from 2019-11-02 10-13-53

node version: v10.15.3
npm version: 6.4.1
OS: Ubuntu 18.04.3 LTS
OS Type: 64-bit

from react-isomorphic-data.

jackyef avatar jackyef commented on May 24, 2024

Could you support axios please?

Unfortunately, in the interest of keeping the library small, I prefer to keep the library to use the native fetch API for now 🙏

I'm testing on my project and it doesn't work 😢

Interesting, may I look at your repo to find out what the problem may be? Or can you provide me with a reproduction?

from react-isomorphic-data.

jackyef avatar jackyef commented on May 24, 2024

Closing due to the inactivity. Feel free to bump this issue if you still have questions!

from react-isomorphic-data.

Related Issues (20)

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.