Last active
August 29, 2015 14:09
-
-
Save koistya/a834b021f4e9f93d8cda to your computer and use it in GitHub Desktop.
Which naming convention do you use when create React components?
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
| export class ComponentA { | |
| render() { | |
| return <form onSubmit={this.handleSubmit}>...</form>; | |
| }, | |
| handleSubmit(e) { | |
| // TODO: handle submit | |
| } | |
| } |
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
| export class ComponentA { | |
| render() { | |
| return <form onSubmit={this._handleSubmit}>...</form>; | |
| }, | |
| _handleSubmit(e) { | |
| // TODO: handle submit | |
| } | |
| } |
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
| export class ComponentC { | |
| render() { | |
| return <form onSubmit={this._onSubmit}>...</form>; | |
| }, | |
| _onSubmit(e) { | |
| // TODO: handle submit | |
| } | |
| } |
I used componentC before, but recently changed to ComponentA.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Personally prefer first one