5.1.0 • Published 5 years ago
react-bicycle v5.1.0
React Bicycle
React bindings for the bicycle data synchronisation library
Usage
For an full demo of a task list app see:
- with ts-bicycle src/demo/ts-hooks and src/demo/ts-schema
- without ts-bicycle src/demo/js-hooks and src/demo/js-schema
These demos are API compatible, so you can use either client with either backend.
import React from 'react';
import ReactDOM from 'react-dom';
import BicycleClient from 'bicycle/client';
import useQuery, {useClient, BicycleProvider} from 'react-bicycle';
function App() {
const client = useClient();
const q = useQuery({myField: true});
// If the query result has not yet loaded, or has errored
// render an appropriate placeholder.
// `q` has properties to allow you to render your own custom
// loading indicator or error message.
if (!q.loaded) return r.render();
// client.update('Root.setMyField', {value})
return <div>My Field: <strong>{q.result.myField}</strong></div>;
}
const client = new BicycleClient();
ReactDOM.render(
<BicycleProvider client={client}><AppContainer/></BicycleProvider>,
document.getElementById('container'),
);
5.1.0
5 years ago
5.0.0
5 years ago
4.0.0
6 years ago
3.1.2
7 years ago
3.1.1
7 years ago
3.1.0
7 years ago
3.0.0
7 years ago
3.0.0-rc.6
7 years ago
3.0.0-rc.5
7 years ago
3.0.0-rc.4
7 years ago
3.0.0-rc.3
7 years ago
3.0.0-rc.2
7 years ago
3.0.0-rc.1
7 years ago
2.4.0
7 years ago
2.3.0
7 years ago
2.2.0
8 years ago
2.1.0
8 years ago
2.0.0
8 years ago
1.1.1
8 years ago
1.1.0
8 years ago
1.0.2
8 years ago
1.0.1
8 years ago
1.0.0
8 years ago