Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/447.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在React^16.8.0(使用钩子的函数组件)中使用jQuery?_Javascript_Jquery_Reactjs_Html5 Canvas - Fatal编程技术网

Javascript 如何在React^16.8.0(使用钩子的函数组件)中使用jQuery?

Javascript 如何在React^16.8.0(使用钩子的函数组件)中使用jQuery?,javascript,jquery,reactjs,html5-canvas,Javascript,Jquery,Reactjs,Html5 Canvas,我是新手。 我希望在react中使用jQuery将图像提取到画布。 但正如你在后面看到的,我不能使用$。 你能告诉我原因吗? 谢谢你的合作 function display(extract) { const canvas = $('#overlay').get(0) api.match(canvas, $('#inputImg').get(0)) $('#Container').empty() Images.forEach(canvas => $('#Container

我是新手。 我希望在react中使用jQuery将图像提取到画布。 但正如你在后面看到的,我不能使用$。 你能告诉我原因吗? 谢谢你的合作

function display(extract) {

  const canvas = $('#overlay').get(0)
  api.match(canvas, $('#inputImg').get(0))

  $('#Container').empty()
  Images.forEach(canvas => $('#Container').append(canvas))

}

很可能是您忘记为JQuery添加必要的模块,或者添加不正确

您的主题上有一个类似的主题:


希望它能有所帮助:)

很可能您忘记为JQuery添加必要的模块,或者添加不正确

您的主题上有一个类似的主题:


希望有帮助:)

根据React版本^16.8.0的升级,它不能使用jquery。根据React版本^16.8.0的升级,它不能使用jquery。