Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: simplify code only deleting 'else' #208

Merged
merged 1 commit into from
Aug 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/botonic-react/src/components/button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export const Button = props => {
else if (props.payload) sendPayload(props.payload)
else if (props.url) {
window.open(props.url)
props.onClick()
} else if (props.onClick) props.onClick()
}
if (props.onClick) props.onClick()
Copy link
Contributor

@dpinol dpinol Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another difference is that now props.onClick() is also called when there's path or payload. this is the expected behaviour right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes because despite of being a path or payload we can want to call a method

}

const renderBrowser = () => {
Expand Down