Skip to content

Instantly share code, notes, and snippets.

@erdemuslu
Created April 25, 2020 11:31
Show Gist options
  • Save erdemuslu/de4cf9b57bf501f621f14afdbb8d6b05 to your computer and use it in GitHub Desktop.
Save erdemuslu/de4cf9b57bf501f621f14afdbb8d6b05 to your computer and use it in GitHub Desktop.
import React from 'react';
import { inject, observer } from 'mobx-react';
const View = (observer(({ status, lyricsData }) => (
<div>
<h1>Sarki sozu:</h1>
<p>{status === 'loading' && 'Yukleniyor...'}</p>
<p>{status === 'error' && 'Bir hata olustu'}</p>
<p dangerouslySetInnerHTML={{ __html: status === 'done' ? lyricsData : '' }} />
</div>
)));
export default inject((stores) => ({
status: stores.Store.status,
lyricsData: stores.Store.lyricsData,
}))(View);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment