Skip to content
This repository was archived by the owner on Oct 29, 2021. It is now read-only.

Commit 4d6ba5c

Browse files
authored
Rename and export example component in the docs
1 parent 91501fb commit 4d6ba5c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

readme.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,12 @@ Now this custom media query and custom properties will be available in all CSS f
171171
```
172172

173173
```jsx
174-
// index.js
174+
// kitten-image.js
175175
import React from 'react'
176176
import { customMedia, customProperties } from './global.css'
177177
import styles from './style.css'
178178

179-
const Image = () => (
179+
const KittenImage = () => (
180180
<img
181181
className={styles.image}
182182
alt="a kitten"
@@ -189,6 +189,8 @@ const Image = () => (
189189
`}
190190
/>
191191
)
192+
193+
export default KittenImage
192194
```
193195

194196
**Always import your customs.** Even if you're not using the exported values in JavaScript, import `global.css` at least once in your app in order to ensure that its contents end up in your CSS. It's true that postcss-preset-env provides fallbacks for browsers that don't support custom properties, but those that do will try to use them and fail if they don't exist.

0 commit comments

Comments
 (0)