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

problem when fetch contentState from api #60

Open
mikasaloliz opened this issue Nov 8, 2019 · 0 comments
Open

problem when fetch contentState from api #60

mikasaloliz opened this issue Nov 8, 2019 · 0 comments

Comments

@mikasaloliz
Copy link

it was rendered normally when i use data from local json file but it's not render when i fetch contentState from api even its a same data
here a code that i use to fetch data
const fetchdata = await fetch('https://test.com/api/story') const jsondata = await fetchdata.json(); this.setState({data:jsondata})

a log from state.data where i save fetched data to
{"blocks":[{"key":"d949g","text":"dasfsdaf","type":"unstyled","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}}],"entityMap":{}}
a log from local json
{"blocks": [{"data": [Object], "depth": 0, "entityRanges": [Array], "inlineStyleRanges": [Array], "key": "d949g", "text": "dasfsdaf", "type": "unstyled"}], "entityMap": {}}

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