Created
October 25, 2019 05:13
-
-
Save leopard627/4a414863179bce25abfce6e9a5a45c9f to your computer and use it in GitHub Desktop.
react 에서 array의 index를 삭제하는 핸들러 패턴
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deleteCharHandler = (index) => { | |
const text = this.state.content.split(''); | |
text.splice(index, 1); | |
const updatedText = text.join(''); | |
this.setState({content: updatedText}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment