Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

320
Views
Material UI with styled-components - forwardedAs doesn't work

I am using React, Material UI with styled-components.
Could you please help me to adjust that? forwardedAs doesn't work.

CoursesPage.style.js

import styled from 'styled-components';
import { Button as ButtonComponent } from '../../components/Button/Button';

export const Button = styled(ButtonComponent)`
  text-decoration: none;
`;

CoursesPage.jsx

import { Link } from 'react-router-dom';
import { Button } from './CoursesPage.style';

<Button
    to='/courses/add'
    variant='outlined'
    size='small'
    forwardedAs={Link}
>
    Add new course
</Button>

Button.jsx

import { StyledButton } from './Button.style';

export const Button = (props) => (
    <StyledButton {...props}>{props.children}</StyledButton>
);

Button.style.jsx

import { styled } from '@mui/material/styles';
import MUIButton from '@mui/material/Button';

export const StyledButton = styled(MUIButton)`
    color: #000;
    border: 1px solid #474747;
    text-transform: initial;

    &:hover {
        background-color: #d0d0d0;
        border: 1px solid #474747;
    }
`;
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!