Created
February 5, 2017 15:14
-
-
Save NiGhTTraX/fac19956deee52822d59d6f8c17ce1a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function inject(deps, Component) { | |
return class Injector extends React.Component { | |
render() { | |
return <Component {...deps} {...this.props} />; | |
} | |
}; | |
} | |
const SafeTodo = inject(Todo, { DeleteTodo: ConfirmButton }); | |
render(<TodoList Todo={SafeTodo} />); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment