react-copy-to-clipboard icon indicating copy to clipboard operation
react-copy-to-clipboard copied to clipboard

Component.js:28 Uncaught TypeError: Super expression must either be null or a function, not undefined

Open thanhthang20 opened this issue 7 years ago • 5 comments

I got this error right here -> import {CopyToClipboard} from 'react-copy-to-clipboard';

React v16

thanhthang20 avatar Oct 11 '17 11:10 thanhthang20

You are destructuring. Try using:

import CopyToClipboard from 'react-copy-to-clipboard'

Without the curly brackets.

mmemory avatar Oct 12 '17 22:10 mmemory

I'm seeing the same issue. It's not a problem with the destructuring syntax.

SamBallantyne avatar Oct 16 '17 21:10 SamBallantyne

Any way to reproduce this? Like codepen or something?

nkbt avatar Nov 05 '17 23:11 nkbt

I had the same issue where the superClass was undefined in function _inherits(subClass, superClass) I did a workaround by simply setting the superClass = null under if (typeof superClass !== "function" && superClass !== null)

It seems to work for now...

ssc9309 avatar Nov 20 '17 16:11 ssc9309

the same error if i use: import CopyToClipboard from 'react-copy-to-clipboard'; can be some version (react) problem ?

mikethejet avatar Mar 22 '18 09:03 mikethejet