Skip to content

Commit

Permalink
0.1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitriy Kubyshkin committed Apr 5, 2015
1 parent 3d300be commit c475261
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 6 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
0.1.0 / 2015-04-05
==================

* Proof of concept release.
* Support for Rendering and re-rendering and unmounting React Component trees.

0.0.4 / 2015-04-05
==================

* Preparation for minor release

0.0.3 / 2015-04-05
==================

Expand Down
55 changes: 50 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,62 @@
`react-qml` is a bridge library that allows to use React.js with QML.

## Roadmap

- [x] rendering and re-rendering and unmounting React Component trees. (0.1.0)
- [ ] components for other QML primitives like `Text`, `Item`, `Image`, etc.
- [ ] event listeners

## Install

```bash
$ npm install --save react-qml
```
At the moment ReactQml requires special manual bundling before it can be used inside Qml, so you have to download javascript bundle manually from [releases pages|https://github.com/grassator/react-qml/releases].

After that place it in your QML root, and import by adding following line at the top your `main.qml`:

## API
```qml
.import 'ReactQml.js' as React
```

_(Coming soon)_
## Example

Usage of `ReactQml` is pretty straightforward — the only difference from web version is that you need to pass id of the qml item to `React.render` instead of DOM node. For example:

```qml
import QtQuick 2.4
import QtQuick.Controls 1.3
import "js/ReactQml.js" as React
ApplicationWindow {
id: root
title: qsTr("React QML")
width: 300
height: 300
visible: true
function reactRender(x, y) {
var props = {
x: 100,
y: 100,
width: 100,
height: 100,
color: '#000'
};
var childProps = {
x: 25,
y: 25,
width: 50,
height: 50,
color: '#fff'
};
var child = React.createElement(React.Rectangle, childProps);
React.render(React.createElement(React.Rectangle, props, child), root);
}
Component.onCompleted: {
reactRender();
}
}
```


## Contributing
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-qml",
"description": "Bridge library from React.js to Qt QML",
"version": "0.0.4",
"version": "0.1.0",
"homepage": "https://github.com/grassator/react-qml",
"bugs": "https://github.com/grassator/react-qml/issues",
"license": "MIT",
Expand Down

0 comments on commit c475261

Please sign in to comment.