Skip to content

Commit 271f1a8

Browse files
committed
Adds styles prop to <Link /> (#11)
1 parent e79090d commit 271f1a8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Link/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,11 @@ export default class Link extends React.PureComponent {
5353
}
5454

5555
render() {
56+
const { styles } = this.props;
5657
return (
5758
<path
5859
ref={(l) => { this.link = l; }}
59-
style={this.state.initialStyle}
60+
style={{ ...this.state.initialStyle, ...styles }}
6061
className="linkBase"
6162
d={this.drawPath()}
6263
/>
@@ -75,4 +76,5 @@ Link.propTypes = {
7576
'elbow',
7677
]).isRequired,
7778
transitionDuration: PropTypes.number.isRequired,
79+
styles: PropTypes.object.isRequired,
7880
};

src/Link/tests/index.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ describe('<Link />', () => {
2020
pathFunc: 'diagonal',
2121
orientation: 'horizontal',
2222
transitionDuration: 500,
23+
styles: {},
2324
};
2425

2526

0 commit comments

Comments
 (0)