Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
Further refinement
Browse files Browse the repository at this point in the history
  • Loading branch information
HammadTheOne committed Mar 14, 2020
1 parent 5f7e930 commit da999d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/components/Link.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default class Link extends Component {
}

render() {
const {className, style, id, href, loading_state} = this.props;
const {className, style, id, href, loading_state, children} = this.props;
/*
* ideally, we would use cloneElement however
* that doesn't work with dash's recursive
Expand All @@ -73,9 +73,9 @@ export default class Link extends Component {
href={href}
onClick={e => this.updateLocation(e)}
>
{isNil(this.props.children)
? this.props.href
: this.props.children}
{isNil(children)
? href
: children}
</a>
);
}
Expand Down
8 changes: 0 additions & 8 deletions tests/integration/link/test_link_children.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,4 @@ def display_children(children):

dash_dcc.start_server(app)

href_as_children = dash_dcc.driver.execute_script(
'''
return document.getElementById("link1").text;
'''
)

dash_dcc.wait_for_text_to_equal("#link1", "/page-1")

assert href_as_children == "/page-1"

0 comments on commit da999d5

Please sign in to comment.