Skip to content

Commit b9463c2

Browse files
committed
revert prettier format on readme
1 parent 226be80 commit b9463c2

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

README.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ Previous versions (< 3.0.0) implemented the v0 proposal, which was only implemen
55

66
## Usage
77

8-
Import `register` and call it with your component, a tag name<strong>\*</strong>, and a list of attribute names you want to observe:
8+
Import `register` and call it with your component, a tag name<strong>*</strong>, and a list of attribute names you want to observe:
99

1010
```javascript
1111
import register from 'preact-custom-element';
1212

13-
const Greeting = ({ name = 'World' }) => <p>Hello, {name}!</p>;
13+
const Greeting = ({ name = 'World' }) => (
14+
<p>Hello, {name}!</p>
15+
);
1416

1517
register(Greeting, 'x-greeting', ['name']);
1618
```
@@ -40,15 +42,15 @@ import register from 'preact-custom-element';
4042

4143
// <x-greeting name="Bo"></x-greeting>
4244
class Greeting extends Component {
43-
// Register as <x-greeting>:
44-
static tagName = 'x-greeting';
45+
// Register as <x-greeting>:
46+
static tagName = 'x-greeting';
4547

46-
// Track these attributes:
47-
static observedAttributes = ['name'];
48+
// Track these attributes:
49+
static observedAttributes = ['name'];
4850

49-
render({ name }) {
50-
return <p>Hello, {name}!</p>;
51-
}
51+
render({ name }) {
52+
return <p>Hello, {name}!</p>;
53+
}
5254
}
5355
register(Greeting);
5456
```
@@ -58,19 +60,16 @@ If no `observedAttributes` are specified, they will be inferred from the keys of
5860
```js
5961
// Other option: use PropTypes:
6062
function FullName(props) {
61-
return (
62-
<span>
63-
{props.first} {props.last}
64-
</span>
65-
);
63+
return <span>{props.first} {props.last}</span>
6664
}
6765
FullName.propTypes = {
68-
first: Object, // you can use PropTypes, or this
69-
last: Object, // trick to define untyped props.
66+
first: Object, // you can use PropTypes, or this
67+
last: Object // trick to define untyped props.
7068
};
7169
register(FullName, 'full-name');
7270
```
7371

72+
7473
## Related
7574

76-
[preact-shadow-dom](https://github.com/bspaulding/preact-shadow-dom)
75+
[preact-shadow-dom](https://github.com/bspaulding/preact-shadow-dom)

0 commit comments

Comments
 (0)