The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Redux: Extracting Presentational Components (AddTodo, Footer, FilterLink)

Redux: Extracting Presentational Components (AddTodo, Footer, FilterLink)

8:35
Learn how to separate the looks from the behavior by extracting presentational components.
Watch this lesson now
Avatar
egghead.io

Learn how to separate the looks from the behavior by extracting presentational components.

Avatar
Arthur

Hi,

Thanks for the tutorial it's been really great. One question I had on this lesson is, why was the onClick action removed from FilterLink and moved up as a prop on the Footer? While I understand the desire to split container components from presentation components, it seems like this is a step back as I now have to remember to attach the onClick prop to each FilterLink in Footer instead of having it in one place in the FilterLink component itself. While I could see this being useful if you wanted each instance of FilterLink to fire a different action, it seems unnecessary when all three are firing the same action. Is there another way to handle this that would get the best of both worlds?

Also, a comment on the use of JS Bin for the entire lesson. Right around this chapter it became pretty difficult to keep track of all the elements in one file in a browser based IDE/text editor. It might be helpful to break out the ToDo example into multiple files as this would show a recommended folder/application structure.

Thanks for the tutorial and I hope more are in the future!

Avatar
Arthur

My first question was answered in the very next chapter. :)

In reply to Arthur
Avatar
compile

function const TodoApp replaced container component class TodoApp.
After doing the above its no longer possible to log live store updates to console.
It was possible to log live store updates to console inside of component class TodoApp.
Now logging is done outside of function const TodoApp but its not live?

Avatar
Arijit Bhattacharya

If you functional components is sounding new to you, this post will help undertsand this update released in React 0.14

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?