iansinnott / react-string-replace

A simple way to safely do string replacement with React components
MIT License
652 stars 56 forks source link

In safari browser onClick not clickable #14

Open deepak-shinde opened 7 years ago

deepak-shinde commented 7 years ago

reactStringReplace(title, /#(\w+)/g, (match, i) => ( <a key={match + i} data-hash={match} onClick={this.onclick} >#{match} ))

iansinnott commented 7 years ago

Can you elaborate on this? I'm not sure what bug you're seeing based on the description

deepak-shinde commented 7 years ago

Inside reactStringReplace I used anchor tag( <a key={match + i} data-hash={match} onClick={this.onclick} >)but on safari onClick event not triggering. Working on other browser.

iansinnott commented 7 years ago

Can you post the code? I don't see any anchor tags in the example in your first comment.

nahumzs commented 4 years ago

This is nothing to do with this library, in safari any link lacking of href its not clickable, if your intention is to visit an internal or external page you don't need the onClick, if you want to use the link as a button you should use a button instead.