我有这样的代码,它创建了一个播放器组件,其中包含setSpell方法。class Player extends React.Component { super(props);
this.setState({spells: newSpellsArray});在另一个功能组件中useState(props.p1); where
我知道,作为函数的结果,不能将图像的源传递给StaticImage组件。但是,有谁能向我解释一下这两个例子的区别吗?import React from 'react'
import { StaticImage } from 'gatsby-plugin-image' // to take image data andStaticImage src={data.imageSrc} alt="alt text"