我正在尝试使用react-image-annotate但是当我第一次尝试设置它时它给了我这个问题。
这是我如何使用它:
import React from 'react'
import ReactImageAnnotate from 'react-image-annotate'
function ImageAnnotator() {
return (
<ReactImageAnnotate
selectedImage="https://images.unsplash.com/photo-1561518776-e76a5e48f731?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=750&q=80"
// taskDescription="# Draw region around each face\n\nInclude chin and hair."
// images={[
// { src: 'https://example.com/image1.png', name: 'Image 1' },
// ]}
// regionClsList={['Man Face', 'Woman Face']}
/>
)
}
export default ImageAnnotator
Run Code Online (Sandbox Code Playgroud)
如果这很重要,我正在使用 Next.js
更新 1
我尝试使用Alejandro Vales 建议的这个babel 插件。它给出了与以前相同的错误。这是babel我的关键package.json:
"babel": {
"presets": [
"next/babel"
],
"plugins": [
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
} …Run Code Online (Sandbox Code Playgroud) display-4我想在 的样式中使用 bootstrap 的类styled-component。
这styled-component:
const Heading = styled.h2`
font-weight: bold,
color: #968c8c,
`;
Run Code Online (Sandbox Code Playgroud)
我应该将display-4引导类放在styled-component. className='display-4'我知道每次使用该组件时我都可以这样做Heading,但肯定有更好的方法吗?