We will learn how to fire up an async request when the route changes.
Would this following achieve the same thing with the same performance as the componentDidUpdate part? componentWillReceiveProps(nextProps) { if(this.props.filter !== nextProps.filter) { fetchTodos(nextProps.filter).then(todos => ...) } }
Could you explain when to use componentWillReceiveProps and when componentDidUpdate? In every tutorial I see, people always use componentWillReceiveProps...
Regarding the 'Link' component found within 'FilterLink', the 'All' link was not functioning. In order to get it to work I needed to have filter = '/' instead of an empty string when the conditional is true:
filter === 'all' ? '/' : filter (edited filter = '/')
Vs.
filter === 'all' ? '' : filter (original filter = '')
Link Component below,
Link to={filter === 'all' ? '/' : filter} activeStyle={{ textDecoration: 'none', color: 'black', }} > {children} Link
hi,
github link is broken, can you please add it?