Skip to content

Commit

Permalink
fix: Fix #108
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed May 10, 2021
1 parent 280f458 commit 9481976
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ function ReactCodeMirror(props = {}, ref) {
const eventDict = {};
eventHandle.forEach((ele) => {
const name = ele.slice(2);
eventDict[ele] = name.replace(name[0],name[0].toLowerCase());
if (name && name[0]) {
eventDict[ele] = name.replace(name[0], name[0].toLowerCase());
}
});

return eventDict;
Expand Down

0 comments on commit 9481976

Please sign in to comment.