question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typing for react-step-progress-bar

See original GitHub issue

First of all, thank you for this amazing library, now that i’m using it in a Typescript project, i was looking for its types i tried npm install @types/react-step-progress-bar but it does not exist.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

19reactions
ghernandezrcommented, Mar 26, 2021

I solve this issue declaring my own .d.ts file, I am using create-react-app, this search for the file src/global.d.ts This is how it look to me, any suggestion is welcome:

declare module 'react-step-progress-bar' {
  interface ProgressBarProps {
    percent?: number;
    filledBackground?: any;
    height?: string | number;
    stepPositions?: number;
  }

  interface StepProps {
    transition?: any;
    position?: any;
  }
  class ProgressBar extends React.Component<ProgressBarProps, any> {}
  class Step extends React.Component<StepProps, any> {}
}  

Thanks!!!

6reactions
andresdsepcommented, Feb 9, 2022

Had a closer look to the package code and made a couple of changes to @ghernandezr’s types:

declare module 'react-step-progress-bar' {
  import React from 'react';

  interface ProgressBarProps {
    percent: number;
    stepPositions?: Array<number>;
    unfilledBackground?: string;
    filledBackground?: string;
    width?: number;
    height?: number;
    hasStepZero?: boolean;
    text?: string;
  }
  interface StepProps {
    children: (props: {
      accomplished: boolean;
      transitionState: string;
      index: number;
      position: number;
    }) => React.ReactNode;
    transition?: 'scale' | 'rotate' | 'skew';
    transitionDuration?: number;
  }
  class ProgressBar extends React.Component<ProgressBarProps, any> {}
  class Step extends React.Component<StepProps, any> {}
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

react-step-progress
Multi step and dynamic progress indicator for react. ... TypeScript icon, indicating that this package has built-in type declarations.
Read more >
React Progress Bar for a Multi-Step Form - YouTube
Learn how to build a React progress bar for a multi- step form. We'll look at the progress element and how to add...
Read more >
react-step-progress-bar examples
Learn how to use react-step-progress-bar by viewing and forking example apps that make use of react-step-progress-bar on CodeSandbox.
Read more >
react-step-progress-bar - npm package
Learn more about react-step-progress-bar: package health score, popularity, security, maintenance, versions and more.
Read more >
Support for step progress bar type in React Validated
Check out the feature request in React - ProgressBar - Support for step progress bar type in React.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found