FormidableLabs / formidable-landers

One header and one footer to rule over them all.
14 stars 4 forks source link

Link configuration props #279

Closed DDunc closed 5 years ago

DDunc commented 5 years ago

The assumption that we will always use anchor tags with SSR is no longer true, nor do we want to assume a one-size-fits all approach for what the activeLink logic will be, so we're providing the previous hardcoding as the sensible default: props => props.current === props.item.path while still allowing configuration.

Additionally, by default we want to skip a full page reload when the current path is selected again, but we also don't want to make that behavior impossible since that would be swapping out one set of present assumptions for another set of present assumptions, and the future remains clouded in mystery.

This is meant to meet an immediate need for the new formidable.com, in the long run exporting configurable partials and allowing for full per-project composition/configuration idiomatically with React seems more accessible than handling in the build/transpilation which will necessarily vary by build tool and build tool version.

boygirl commented 5 years ago

LGTM since nested properties are guaranteed.