Skip to content

Footer as prop not working #1248

@revolterab

Description

@revolterab
  • [X ] I have searched the Issues to see if this bug has already been reported
  • [X ] I have tested the latest version

Steps to reproduce

import { Footer } from "flowbite-react";
import { Link } from "react-router-dom";

    <Footer container>
	    <div className="w-full text-center">
		    <div className="w-full justify-between sm:flex sm:items-center sm:justify-between">
			    <Footer.Brand
				    as={Link}
				    to="/"
				    src="https://flowbite.com/docs/images/logo.svg"
				    alt="Flowbite Logo"
				    name="Flowbite"
			    />
			    <Footer.LinkGroup>
				    <Footer.Link as={Link} to="/about">
					    About
				    </Footer.Link>
				    <Footer.Link as={Link} to="/contact">
					    Contact
				    </Footer.Link>
			    </Footer.LinkGroup>
		    </div>
		    <Footer.Divider />
		    <Footer.Copyright as={Link} to="/" by="Flowbite™" year={2022} />
	    </div>
    </Footer>

Current behavior

When I assign the as prop to the Footer elements, I get below errors

Type '{ as: ForwardRefExoticComponent<LinkProps & RefAttributes>; to: string; by: string; year: number; }' is not assignable to type 'IntrinsicAttributes & CopyrightProps'.
Property 'as' does not exist on type 'IntrinsicAttributes & CopyrightProps'.

Type '{ children: string; as: ForwardRefExoticComponent<LinkProps & RefAttributes>; to: string; }' is not assignable to type 'IntrinsicAttributes & FooterLinkProps'.
Property 'to' does not exist on type 'IntrinsicAttributes & FooterLinkProps'.

Expected behavior

The Footer component should accept the as prop just like the other components do (such as Sidebar, Navbar etc.)

Context

I am trying to use the as prop

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions