简体   繁体   中英

how to resolve overload errors in reactjs

import React from 'react'
import { Link } from 'react-scroll'
import "./Protocol.css"
import { ANALYTICS, TRADE, USERS, TRADERS, VOTES, ZEROES } from "../../Constants"
const Protocol = () => {
    return (
        <div className="Protocol_container">
            <div className="Protocol_heading">
                {ANALYTICS}
            </div>
            <div className="Protocol_content">
                <Link>
                    <p>{ZEROES}</p>{TRADE}
                </Link>
                <Link >
                    <p>{ZEROES}</p>{USERS}
                </Link>
                <Link >
                    <p>{ZEROES}</p>{TRADERS}
                </Link>
                <Link>
                    <p>{ZEROES}</p>{VOTES}
                </Link>
            </div>

        </div>
    )
}
export default Protocol

getting err as

No overload matches this call. Overload 1 of 2, '(props: LinkProps | Readonly): Link', gave the following error. Property 'to' is missing in type '{ children: (string | Element)[]; }' but required in type 'Readonly'. Overload 2 of 2, '(props: LinkProps, context: any): Link', gave the following error. Property 'to' is missing in type '{ children: (string | Element)[]; }' but required in type 'Readonly'.

在此处输入图片说明

链接需要道具到=“去哪里”,如果你不想去任何地方就使用to=“#”

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM