Skip to content

Commit d7174e7

Browse files
authored
Merge pull request #29 from podium-lib/add_jsx_attribute_methods
docs: add .toJsxAttributes() methods
2 parents debc5aa + 7c6412b commit d7174e7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/api/assets.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,14 @@ An `AssetCSS` instance has the following methods:
438438

439439
Returns a JSON representation of the `AssetCSS` instance.
440440

441+
### .toJsxAttributes()
442+
443+
Returns a JSON representation of the `AssetCSS` instance ready for use in a JSX link tag
444+
445+
```jsx
446+
<link {...css.toJsxAttributes()} />
447+
```
448+
441449
### .toHTML()
442450

443451
Returns an HTML `<link>` element as a string representation of the `AssetCSS`
@@ -472,6 +480,14 @@ An `AssetJS` instance has the following methods:
472480

473481
Returns a JSON representation of the `AssetJS` instance.
474482

483+
### .toJsxAttributes()
484+
485+
Returns a JSON representation of the `AssetJS` instance ready for use in a JSX script tag.
486+
487+
```jsx
488+
<script {...js.toJsxAttributes()}></script>
489+
```
490+
475491
### .toHTML()
476492

477493
Returns an HTML `<script>` element as a string representation of the `AssetJS`

0 commit comments

Comments
 (0)