Skip to content
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

How to use Trello object in another component #12

Open
NaelAwayes opened this issue Jul 7, 2020 · 0 comments
Open

How to use Trello object in another component #12

NaelAwayes opened this issue Jul 7, 2020 · 0 comments

Comments

@NaelAwayes
Copy link

Hi,

For starters, please forgive me if the answer to my question seems obvious, i'm a newcomer to react.
I read issue #4 and tinkered a lot with my project to try and make it work, but to no avail.

I have a component called Login which renders <TrelloClient /> and the authorization goes fine, and if I call Trello.rest("GET", "/members/me", res => console.log(res), err => console.log(err)) in authorizeOnSuccess it executes perfectly.

However, if in the authorizeOnSuccess function I decide to navigate to my other component (using reach-router), and in that component I try calling Trello.rest("GET", "/members/me", res => console.log(res), err => console.log(err)) in the componentDidMount method, I get this error :

react_trello_client__WEBPACK_IMPORTED_MODULE_2__.Trello.rest is not a function

I might be wrong on this one, but it seems to me that the Trello object resets once I navigate although I assumed it would be set globally.

Could you please point to me what I'm doing wrong ?

Thanks in advance,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant