1.1.2 • Published 5 years ago

react-form-editables v1.1.2

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

React Form Editable

A React component that easily allows inline editing!

Currently supporting Editable Inputs. Simply hover over the component, if enabled, and click to enable editing. Once you're finished editing, click Submit and catch the new input value with a prop function. Voila!

Setup

  1. npm install --save react-form-editables
  2. In your React component, import the Component and pass in the appropriate arguments. See example below.

CRA Example

import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import { EditableInput } from 'react-form-editables';

class App extends Component {
    state = {
        textInputValue: "I am the original value",
    }

    handleSubmit = (updatedValue) => {
        console.log("Updated value: ", updatedValue);
        
        this.setState({ textInputValue: updatedValue })
    };

    render() {
        return (
            <div className="App">
                <header className="App-header">
                <img src={logo} className="App-logo" alt="logo" />
                <h1 className="App-title">Welcome to React</h1>
                </header>
                <p className="App-intro">
                To get started, edit <code>src/App.js</code> and save to reload.
                </p>
                
                <EditableInput 
                    minInputLength={2}
                    value={this.state.textInputValue}
                    handleSubmit={this.handleSubmit}
                />
                
            </div>
        );
    }
}

export default App;

Compoent Props

PropsDefinitionRequired
minInputLengthMinimum character length for input valuefalse
valueText value to render when not editingfalse
handleSubmitComponent function prop used to return new input valuetrue
1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago