Skip to content

Commit

Permalink
docs: Improve limitations page (#287)
Browse files Browse the repository at this point in the history
* docs: Improve limitations page

* Update limitations.md
  • Loading branch information
layershifter authored Dec 7, 2022
1 parent 1289343 commit 264a0cd
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions apps/website/docs/react/guides/limitations.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ Styles can't be created at runtime which includes dynamic selectors as well.

```jsx
function App(props) {
// ❌ This will not work and throw an expection
// ❌ This will not work and throw an exception
const useClasses = makeStyles({
color: props.color,
[`.${props.area}`]: { display: 'block' },
root: {
color: props.color,
[`.${props.area}`]: { display: 'block' },
}
});
}
```
Expand All @@ -26,9 +28,9 @@ As Griffel performs ahead-of-time [compilation](/react/ahead-of-time-compilation

```jsx
const useClasses = makeStyles({
twoColumns: {},
threeColumns: {},
fourColumns: {},
twoColumns: { /* styles */ },
threeColumns: { /* styles */ },
fourColumns: { /* styles */ },
});

function App(props) {
Expand All @@ -47,12 +49,12 @@ As Griffel performs ahead-of-time [compilation](/react/ahead-of-time-compilation

```jsx
const useClasses = makeStyles({
/* your styles */
root: { /* your other styles styles */ },
});

function App(props) {
const classes = useClasses();
return <div style={{ color: props.color }} />;
return <div className={classes.root} style={{ color: props.color }} />;
}
```

Expand Down

0 comments on commit 264a0cd

Please sign in to comment.