Skip to content

Commit 9481976

Browse files
committed
fix: Fix #108
1 parent 280f458 commit 9481976

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ function ReactCodeMirror(props = {}, ref) {
2929
const eventDict = {};
3030
eventHandle.forEach((ele) => {
3131
const name = ele.slice(2);
32-
eventDict[ele] = name.replace(name[0],name[0].toLowerCase());
32+
if (name && name[0]) {
33+
eventDict[ele] = name.replace(name[0], name[0].toLowerCase());
34+
}
3335
});
3436

3537
return eventDict;

0 commit comments

Comments
 (0)