vueactive
v0.15.0
Published
React bindings for @vue/reactivity.
Downloads
34
Readme
vueactive
React bindings for @vue/reactivity.
Installation
yarn add vueactive @vue/runtime-core
Examples
Counter
import React, { useState } from "react";
import { ref } from "@vue/reactivity";
import { component, useConstant } from "vueactive";
const { Fragment } = component;
const Counter = () => {
return useConstant(() => {
const count$ = ref(0);
return (
<>
<button onClick={() => count$.value--}>-</button>
<Fragment>{count$}</Fragment>
<button onClick={() => count$.value++}>+</button>
</>
);
});
};
export default Counter;