Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React from 'react';
import { annotate, InjectLazy } from 'di';
import Frankenstein from './Frankenstein';
annotate(FrankensteinComponent, new InjectLazy(Frankenstein));
function FrankensteinComponent(createMonster) {
return React.createClass({
getInitialState() {
return {
loaded: false
};
},
componentWillMount() {
fetch(`https://api.github.com/users/${this.props.username}`)
.then((response) => {
return response.json();
})
.then((json) => {
this.setState({
user: createMonster('options', json),
loaded: true