Skip to content

Instantly share code, notes, and snippets.

@Louiefigz
Created May 23, 2017 13:53
Show Gist options
  • Select an option

  • Save Louiefigz/86420bfd58a04131db784c562cdd5593 to your computer and use it in GitHub Desktop.

Select an option

Save Louiefigz/86420bfd58a04131db784c562cdd5593 to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
//When we use export default on a component, we would import that component without
// curly braces like UserInput Below.
import UserInput from "./components/UserInput";
//When we export a component without default:
// example: export class Test extends Component
// We would need to specify the class or constant within {}.
// In this case, we are extracting Test which means it's being exported
// without default.
import { AllTasks } from './components/Tasks';
class App extends Component {
render() {
return (
<div>
{/* Below we are currently still passing through the store function as a prop*/}
<UserInput store={this.props.store} />
{/*In AllTasks Component, we are not passing in store as a function. Rather, we're going to
get our state props by using connect() within the function.*/}
<AllTasks />
</div>
);
}
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment