Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jrdrg authored and John Rodriguez committed Apr 17, 2017
1 parent 43eb312 commit f27db8b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/storyshots/stories/__test__/storyshots.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import initStoryshots from '../../src';

function createNodeMock (element) {
function createNodeMock(element) {
if (element.type === 'input') {
return { scrollWidth: 123 };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ const inputStyles = {
fontSize: 15,
padding: '3px 10px',
margin: 10,
width: '400px'
width: '400px',
};

class ComponentWithRef extends React.Component {
componentDidMount () {
this.props.onLoad('scrollWidth: ' + this.ref.scrollWidth);
componentDidMount() {
this.props.onLoad(`scrollWidth: ${this.ref.scrollWidth}`);
}
setRef (ref) {
setRef(ref) {
this.ref = ref;
}
render () {
render() {
return (
<input
type='text'
type="text"
value={'This component reads its scrollWidth on load.'}
ref={r => this.setRef(r)}
style={inputStyles}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import { storiesOf, action } from '@kadira/storybook';
import ComponentWithRef from './ComponentWithRef';
import React from 'react';
import { storiesOf, action } from '@kadira/storybook';
import ComponentWithRef from './ComponentWithRef';

storiesOf('Component with ref', module)
.add('on mount', () => (
<ComponentWithRef onLoad={action('component mount')} />
));
storiesOf('Component with ref', module).add('on mount', () => (
<ComponentWithRef onLoad={action('component mount')} />
));

0 comments on commit f27db8b

Please sign in to comment.