Skip to content

Commit 6ae659c

Browse files
authored
Merge pull request #63 from fullstackreact/updates/day-08
Update day-08 links, typos
2 parents e0ebbfa + 0ad336d commit 6ae659c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

day-08/post.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ In this section, we're going to look a bit at annotating and packaging our compo
2323

2424
You may have noticed we use `props` quite a bit in our components. For the most part, we'll expect these to be a particular type or set of types (aka an `object` or a `string`). React provides a method for defining and validating these types that allow us to easily expose a component API.
2525

26-
Not only is this a good practice for documentation purposes, it's great for building [reusable react components](https://facebook.github.io/react/docs/reusable-components.html).
26+
Not only is this a good practice for documentation purposes, it's great for building [reusable react components](https://reactjs.org/docs/components-and-props.html).
2727

2828
The `prop-types` object exports a bunch of different types which we can use to define what type a component's prop should be. We can define these using the `propTypes` method in the ES6 class-style React prop:
2929

@@ -42,11 +42,16 @@ From within this `prop`, we can define an object which has the key of a prop as
4242

4343
For instance, the `Header` component we built a few days ago accepts a a prop called `title` and we expect it to be a string. We can define it's type to be a string as such:
4444

45-
> First, we'll need to `import` the `PropTypes` package from the `prop-types` package using the `import` keyword again:
45+
> First, we'll need to `import` the `PropTypes` object from the `prop-types` package using the `import` keyword again:
4646
>
4747
> ```javascript
4848
> import PropTypes from 'prop-types'
4949
> ```
50+
>
51+
> You can also use the `PropTypes` object directly in your browser by adding the following `script` tag in your page
52+
>```html
53+
><script src="https://unpkg.com/[email protected]/prop-types.min.js"></script>
54+
>```
5055
5156
```javascript
5257
import PropTypes from 'prop-types'

0 commit comments

Comments
 (0)