Skip to content

anthonyholmes/use-v-model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

use-v-model

Like v-model in Vue... but for React

Only works on <input> and <select> at the moment

import React from "react";
import { useVModel } from "use-v-model";

function App() {
  // can pass default value
  let name = useVModel("Anthony");
  let email = useVModel();

  return (
    <div>
      <input name="name" {...name} />
      
      // Output the value
      {name.value}
    </div>
  );
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published