Skip to content

Shinyaigeek/add-onEnter-for-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Add-onEnter-For-React

This module is React/Next Component, which enable you add onEnter/onShiftEnter/onControlEnter Method to ChildComponent.

Installation

This module is available as an npm package.

// with npm
npm install add-onenter-for-react

// with yarn
yarn add add-onenter-for-react

Usage

Here is a quick example to get you started, it's all you need:

import AddonEnter from "add-onenter-for-react"

function Enter(){
    alert('Enter!!')
}

function ShiftEnter(){
    alert('ShiftEnter!!')
}

function ControlEnter(){
    alert('ControlEnter!!')
}

function App() {
    return(
        <AddonEnter
          onEnter={Enter()}
          onShiftEnter={ShiftEnter()}
          onControlEnter={ControlEnter()}
        >
        <TextArea />
        </AddonEnter>
    )
}

API

Property type
onEnter ?Function
onShiftEnter ?FUnction
onControlEnter ?Function

About

This is HOC for React/Next.js. This Component add onEnter/onControlEnter/onShiftEnter Event to Component.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published