Skip to content

Instantly share code, notes, and snippets.

@NiGhTTraX
Created February 5, 2017 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NiGhTTraX/fac19956deee52822d59d6f8c17ce1a0 to your computer and use it in GitHub Desktop.
Save NiGhTTraX/fac19956deee52822d59d6f8c17ce1a0 to your computer and use it in GitHub Desktop.
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