'Webpack cant process simple component

I have no idea whats wrong here, I have simple component in one of the /libs/* (I'm using react Nx with typescript) and when I import it in one of the /apps/* it gives this error. What could be wrong?

   ERROR in ../../libs/shared/ui-components/src/lib/Button.tsx 5:9
    Module parse failed: Unexpected token (5:9)
    File was processed with these loaders:
     * ../../node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js
     * ../../node_modules/@nrwl/web/src/utils/web-babel-loader.js
    You may need an additional loader to handle the result of these loaders.
    | import React from 'react';
    | export const Button = () => {
    >   return <>
    |       <button>Button</button>
    |     </>;
    
    webpack compiled with 1 error (d55652eaa706b4e1)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source