Skip to content

Commit 4130a0e

Browse files
authored
Merge pull request #58 from sugarshin/fix-format
Fix code format
2 parents 4cb6e9f + af4a340 commit 4130a0e

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"description": "A React component for PDFObject",
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",
7-
"files": ["lib"],
7+
"files": [
8+
"lib"
9+
],
810
"scripts": {
911
"test": "jest --config jest.config.json",
1012
"test:coverage": "npm test -- --coverage",

src/index.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,6 @@ export class PDFObject extends React.PureComponent<Props> {
5050
assumptionMode: true,
5151
};
5252

53-
private embed = () => {
54-
const { url, containerId, containerProps, ...options } = this.props;
55-
if (pdfobject) {
56-
pdfobject.embed(url, `#${containerId}`, options);
57-
}
58-
}
59-
6053
public componentDidMount() {
6154
this.embed();
6255
}
@@ -71,4 +64,11 @@ export class PDFObject extends React.PureComponent<Props> {
7164
public render() {
7265
return <div {...this.props.containerProps} id={this.props.containerId} />;
7366
}
67+
68+
private embed = () => {
69+
const { url, containerId, containerProps, ...options } = this.props;
70+
if (pdfobject) {
71+
pdfobject.embed(url, `#${containerId}`, options);
72+
}
73+
};
7474
}

0 commit comments

Comments
 (0)