LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code
Loading…
JS
class Image extends React.Component {
  constructor() {
    super();
    this.state = {};
    this.fallback = () => {
      if (this.props.fallbackSrc) {
        this.setState({ failed: true });
      }
    };
  }

  render() {
    if (this.state.failed) {
      return ;
    } else {
      return ;
    }
  }
}

const url = 'https://media.giphy.com/media/l2JJDrvnFUEboRgSQ/giphy.gif';
const brokenUrl = url.replace('gif','glif');
const fallbackUrl = 'https://media.giphy.com/media/uprwwjptZW4Za/giphy.gif';

const app = (
  

Broken image:

Good image:

); React.render(app, document.getElementById('app'));
Term
Sat, 01/13/2018 - 16:17

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv