microlinkhq / sdk

Make any URL embeddable. Turn any URL into a beautiful link preview.

Home Page:https://microlink.io/sdk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Promise for React Available?

karanmartian opened this issue · comments

Hey so this component causes a setState warning if the component is unmounted. Is there some kind of promise/callback available by which I can know when the data is received and loaded into the card?

Hello,

This should be easy to address at the moment the data is fetched:
https://github.com/microlinkhq/sdk/blob/master/packages/react-microlink/src/index.js#L35

Something like this could be enough:

this.setState(data, callback)

Can you clarify why this is necessary? Where are you seeing the warning?