TypeError: this.$el.DataTable is not a function( REACT.JS)

落爺英雄遲暮 提交于 2021-02-08 10:00:48

问题


BACKGROUND:

Hello, i am newbie to react and currently building an application which has datatables .

PROBLEM:

It runs on the local machine(pc) perfectly but when i use the same code in codesandbox then i get TypeError: this.$el.DataTable is not a function. I have tried using datatable & jquery cdns inside the index.html file but it doesn't have any effect. Any hint ,suggestion would be helpful, thanks in advance.

CODE:

https://codesandbox.io/embed/jjwx6n2r93


回答1:


There were two issues in your code. I have commented them in the fork.

https://codesandbox.io/s/8n1my7rxrj?fontsize=14



来源:https://stackoverflow.com/questions/55468698/typeerror-this-el-datatable-is-not-a-function-react-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!