Currying is a useful technique to consolidate event handlers that have very similar patterns, such as in our redirect example above. Rather than having to write two separate
onClick handlers as in lines #29 and #32, we can use a curried function,
handleClick. This function returns the actual click handler function, allowing an argument (
type) to be passed.