Skip to content

chrisalmeida/react-editable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Editable

Making use of React hooks for editing components in place.

Installation

npm install --save chrisalmeida/react-editable#master

Prerequisites

React >= v16.7.0-alpha is needed in order to use hooks.

Example

<Editable
  render={(editable, setEditing) => {
    return (
      <input
        className={!editable ? 'not-editing' : ''}
        onFocus={e => setEditing(e)}
      />
    )
  }}
/>

A create-react-app example is included in example/