In react tutorial:
https://egghead.io/lessons/javascript-redux-react-todo-list-example-filtering-todos
there is main component create with extends:
class TodoApp extends Component {
render() {
const visibleTodos = getVisibleTodos(
this.props.todos,
this.props.visibilityFilter
);
.
. // Input and Button stuff
.
and another components just create like a const that hold a function:
const FilterLink = ({
filter,
children
}) => {
return (
<a href='#'
onClick={e => {
e.preventDefault();
store.dispatch({
type: 'SET_VISIBILITY_FILTER',
filter
});
}}
>
{children}
</a>
)
}
the difference i see, first created with class use a render function, and the another a return function to send back the template.
What are the differences? I've heard components in the future only will be allowed with extend Component ?