cerner / terra-consumer

Consumer reusable components
http://engineering.cerner.com/terra-consumer
Apache License 2.0
10 stars 11 forks source link

Add null check or default prop type for customOnClick props in ProfileLink.jsx #119

Open AirWick219 opened 6 years ago

AirWick219 commented 6 years ago

Issue Description

ProfileLink.jsx crashes onClick if customOnClick prop is not given which cause Link.js to stop here. Then the page would reload instead of rerender. The onClick callback from ProfileLink is passed to SmarkLink.jsx -> NavLink.jsx -> Link.js.

This can be fixed by adding null check or a default prop in ProfileLink.jsx

In addition, I wondered if customOnClick prop should be added in ProfileLinks.jsx as well, so that it is configurable along with other props like isExternal, url or target

Issue Type

Expected Behavior

Current Behavior

Steps to Reproduce

  1. Render ProfileLinks.jsx with multiple ProfileLink.jsx that has propisExternal: false with matching routes
  2. Click on a ProfileLink.
  3. The page redirected.

Environment