Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

improve server example #456

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,18 +191,39 @@ You can use the Attributes Kit on the server too. For instance—you can generat

3. **Use it**

###### ES6

```JavaScript
import React from 'react';
import ReactDomServer from 'react-dom/server'
import ReactDomServer from 'react-dom/server';
import {Attributes} from 'attributes-kit/dist/attributes-kit-server';


const dataStructures = [Refract Element]
const element = React.createElement(Attributes, {
element: [Refract Element]
dataStructures: dataStructures,
element: dataStructures[0]
});

ReactDomServer.renderToString(element);
```

###### ES5

```JavaScript
var AttributesKit = require('attributes-kit/dist/attributes-kit-server');
var ReactDomServer = require('react-dom/server');
var AttributesKit = require('attributes-kit/dist/attributes-kit-server');

const dataStructures = [Refract Element]
const element = React.createElement(AttributesKit.Attributes, {
dataStructures: dataStructures,
element: dataStructures[0]
});

ReactDomServer.renderToString(element);
```


## API

* [`render` Method](#render-method)
Expand Down Expand Up @@ -324,3 +345,4 @@ This project adheres to the [Open Code of Conduct](./CODE_OF_CONDUCT.md). By par
# License

[MIT](./LICENSE.md).