Comments (10)
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!!!!
from react-step-progress-bar.
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> {}
}
from react-step-progress-bar.
ProgressBarProps also needs children so...
declare module 'react-step-progress-bar' {
import React from 'react'
interface ProgressBarProps {
percent: number
stepPositions?: number[]
unfilledBackground?: string
filledBackground?: string
width?: number
height?: number
hasStepZero?: boolean
text?: string
children?:
| React.ReactChild
| React.ReactChild[]
}
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> {}
}
from react-step-progress-bar.
Same issue when i tried in one f my react project
from react-step-progress-bar.
Thank you @tomniermann @andresdsep π I hope the types will be included in future releases!
from react-step-progress-bar.
same issue here π€ππ
from react-step-progress-bar.
Thank you so much for your feedbacks ! I'll use typescript for the 2.0 !
from react-step-progress-bar.
I have same issue in typescript
from react-step-progress-bar.
@pierreericgarcia I'm looking forward to help with adding types and or transforming the code base into typescript but I don't see branches for that matter, I'd love to get in touch with you if there is more I should know about the migration to typescript π
from react-step-progress-bar.
Thank you very much, for typing this awesome libraryπππ
from react-step-progress-bar.
Related Issues (20)
- An in-range update of eslint-plugin-import is breaking the build π¨ HOT 11
- <Step /> position is not respected HOT 1
- Layout Bug in Safari ios9 and IE11
- An in-range update of node-sass-chokidar is breaking the build π¨ HOT 2
- An in-range update of eslint-plugin-jsx-a11y is breaking the build π¨ HOT 2
- An in-range update of eslint-config-airbnb-base is breaking the build π¨ HOT 1
- Not able to use this library HOT 1
- Stuck with error when trying to dynamically create step numbers for the progress bar HOT 1
- Build with styles
- Is there any way to implement a step label? HOT 1
- Should list react-dom under peerDependencies HOT 1
- Legacy context API has been detected within a strict-mode tree HOT 2
- Support passing a className to ProgressBar
- stepPositions (ProgressBar) or position (Step) not working
- Next js 13 Node 18 build issue
- An in-range update of react is breaking the build π¨ HOT 19
- An in-range update of react-transition-group is breaking the build π¨ HOT 9
- An in-range update of eslint-plugin-react is breaking the build π¨ HOT 19
- An in-range update of eslint is breaking the build π¨ HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-step-progress-bar.