devnomic / marquee

A beautiful marquee component for React.
https://marquee-dev.vercel.app
MIT License
392 stars 9 forks source link

feat: allow users to pass in additional props and export the type #1

Closed josemukorivo closed 10 months ago

josemukorivo commented 10 months ago

Changes Made:

Added a MarqueeProps type that extends HTMLDivElement. The type includes additional props such as onChange to allow users to pass more custom props.

Exported the MarqueeProps type for users who may want to reference or extend it.

Reasoning:

This change enhances the flexibility of the Marquee component, allowing users to pass a wider range of props, including native ones like onChange.

Examples:

// Example 1: Using additional props like onChange
<Marquee onChange={(event) => console.log('Marquee changed!', event)}>
  {/* ... */}
</Marquee>
// Example 2: Reference or extend MarqueeProps
interface MyExtendedMarqueeProps extends MarqueeProps {
  customProp: string;
}

const MyExtendedMarquee: React.FC<MyExtendedMarqueeProps> = ({ customProp, ...rest }) => (
  <Marquee {...rest}>
    {/* ... */}
  </Marquee>
);
vercel[bot] commented 10 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marquee ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 16, 2024 6:53am
devnomic commented 10 months ago

Hi! thank you the PR, can you replace single quote with double quote as i haven't setup prettier / husky.

josemukorivo commented 10 months ago

Sure, let me fix the quotes.