react-native-progress-bar icon indicating copy to clipboard operation
react-native-progress-bar copied to clipboard

Plain JS ES6 class works with latest RN

Open phoenixbox opened this issue 9 years ago • 13 comments

@lwansbrough Updated the component to use plain JS ES6 classes which works with newest versions of react-native

🚀

phoenixbox avatar Jul 12 '16 09:07 phoenixbox

TOP!

Actually had to change the styling part, as it was not working correctly with this:

this.style = props.style;

ghost avatar Jul 27 '16 10:07 ghost

Hey @alexanderniebuhr what change did you have to make? Can you paste the code snippet here?

phoenixbox avatar Jul 29 '16 13:07 phoenixbox

<View style={[styles.background, this.style.backgroundStyle, this.style]}> <Animated.View style={[styles.fill, this.style.fillStyle, { width: fillWidth }]}/>

To

<View style={[styles.background, this.props.backgroundStyle, this.props.style]}> <Animated.View style={[styles.fill, this.props.fillStyle, { width: fillWidth }]}/>

I did change this two lines back to the old ones, so I could use the fillStyle prop as shown in the readme from the module in my main class component :) There might be an other way to set fillStyle, but I want to set it in my class and not in the node_modules folder

ghost avatar Jul 29 '16 14:07 ghost

@alexanderniebuhr ah ok good catch! I missed that because I was using default stylings, tried to customize it and I see what you mean. Thanks for the heads up!

I'll update the PR 🚀 👍 🌈

phoenixbox avatar Jul 30 '16 08:07 phoenixbox

No probs. I think there might be, a way with your option, but for me it was the easiest to change it back :)

ghost avatar Jul 30 '16 08:07 ghost

@alexanderniebuhr ok I made an update, the style override works for me now

You can test it in your project via this if you like 👍

"react-native-progress-bar": "git+https://github.com/phoenixbox/react-native-progress-bar.git#imports-update"

phoenixbox avatar Jul 30 '16 08:07 phoenixbox

I'll try soon , and will post feedback here :)

ghost avatar Jul 30 '16 08:07 ghost

cool!

phoenixbox avatar Jul 30 '16 08:07 phoenixbox

Yeah style works, but then I had to change one thing more:

export default class ProgressBar extends Component { to class ProgressBar extends Component {

And adding following line at the end:

module.exports = ProgressBar;

As without I will get following error: simulator screen shot 30 07 2016 10 46 02

ghost avatar Jul 30 '16 08:07 ghost

@alexanderniebuhr what did you import look like when you used the version as:

export default class ProgressBar extends Component {}

did it look like this?

import ProgressBar from 'react-native-progress-bar';

phoenixbox avatar Aug 02 '16 09:08 phoenixbox

I used import from the readme of the initial module

Von meinem iPhone gesendet

Am 02.08.2016 um 10:01 schrieb Shane Rogers [email protected]:

@alexanderniebuhr what did you import look like when you used the version as:

export default class ProgressBar extends Component {} did it look like this?

import ProgressBar from 'react-native-progress-bar'; — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

ghost avatar Aug 02 '16 19:08 ghost

@alexanderniebuhr @lwansbrough updated ❤️

phoenixbox avatar Aug 11 '16 19:08 phoenixbox

@lwansbrough beep 🚀 :)

phoenixbox avatar Sep 16 '16 09:09 phoenixbox