react-hook-vue-composition

0.0.2 • Public • Published

react-hook-vue-composition

React hook that mimics the Vue Composition API

WIP: the api may change a bit

NPM JavaScript Style Guide

Install

npm install --save react-hook-vue-composition

Usage

import React from "react";
import useVueComposition from "react-hook-vue-composition";

function setup({ ref }) {
  const count = ref(0);

  function increment() {
    count.value++;
  }

  return { count, increment };
}

function CountButton() {
  const { count, increment } = useVueComposition(setup);

  return <button onClick={increment}>Count is: {count}</button>;
}

Check ./example folder for more examples!

License

MIT ©


This hook is created using create-react-hook.

Readme

Keywords

none

Package Sidebar

Install

npm i react-hook-vue-composition

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

590 kB

Total Files

26

Last publish

Collaborators

  • marceloadsj