Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2a74d39

Browse files
committed
Fix stories
1 parent a870ff6 commit 2a74d39

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

‎stories/defaultServiceStory.tsx‎

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,54 @@
11
import { storiesOf } from '@storybook/react';
22
import * as React from 'react';
3-
import withRemoteRender, { RemoteRenderComponent } from '../src/components/withRemoteRender';
3+
import withRemoteRender, {
4+
RemoteRenderComponent
5+
} from '../src/components/withRemoteRender';
46
import { TestScenario } from './utils';
57

68
const stories = storiesOf('With DefaultService', module);
79

810
type ParagraphProps = { text: string };
9-
const Paragraph: React.SFC<ParagraphProps> = ({ text }) => (<p>{text}</p>);
11+
const Paragraph: React.SFC<ParagraphProps> = ({ text }) => <p>{text}</p>;
1012

11-
12-
type ButtonProps = { onClick: Function, n: number };
13+
type ButtonProps = { onClick: Function; n: number };
1314
const Button: React.SFC<ButtonProps> = ({ onClick, n }) => (
1415
<button onClick={e => onClick(n)}>Increment by {n}</button>
1516
);
1617

17-
const RRParagraph = withRemoteRender<ParagraphProps>({ name: 'Paragraph'})(Paragraph);
18-
const RRButton = withRemoteRender<ButtonProps>({ name: 'Button'})(Button);
18+
const RRParagraph = withRemoteRender<ParagraphProps>({ name: 'Paragraph' })(
19+
Paragraph
20+
);
21+
const RRButton = withRemoteRender<ButtonProps>({ name: 'Button' })(Button);
1922

2023
class ButtonText extends React.Component {
21-
state: { clicks: number } = { clicks: 0 }
24+
state: { clicks: number } = { clicks: 0 };
2225

23-
incrementClicks = (n) => {
26+
incrementClicks = n => {
2427
this.setState({ clicks: this.state.clicks + n });
25-
}
28+
};
2629

2730
render() {
2831
return (
2932
<div>
30-
<RRButton onClick={this.incrementClicks} n={-1}/>
31-
<RRButton onClick={this.incrementClicks} n={2}/>
33+
<RRButton onClick={this.incrementClicks} n={-1}/>
34+
<RRButton onClick={this.incrementClicks} n={2}/>
3235
<RRParagraph text={`${this.state.clicks} clicks`} />
3336
</div>
3437
);
3538
}
3639
}
3740

3841
stories.add('Simple Example', () => (
39-
<TestScenario supportedComponents={[RRParagraph]} >
40-
<RRParagraph text="Hola bebe!" />
41-
<RRParagraph text="adios mundo cruel" />
42+
<TestScenario supportedComponents={[RRParagraph]}>
43+
<div>
44+
<RRParagraph text="Hola bebe!" />
45+
<RRParagraph text="adios mundo cruel" />
46+
</div>
4247
</TestScenario>
4348
));
4449

4550
stories.add('Calling Action in externalized components', () => (
46-
<TestScenario supportedComponents={[RRParagraph, RRButton]}>
51+
<TestScenario supportedComponents={[RRParagraph, RRButton]}>
4752
<ButtonText />
4853
</TestScenario>
4954
));

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /