Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

Update to React 16 and move to ES6 #26

Merged
merged 4 commits into from
May 28, 2018

Conversation

sebacruz
Copy link
Contributor

Both updates are related somehow so I put it in the same PR.

Also this should fix #24.

@sebacruz sebacruz changed the title Update to React and move to ES6 Update to React 16 and move to ES6 Oct 20, 2017
@sebacruz sebacruz closed this Oct 20, 2017
@sebacruz sebacruz reopened this Oct 20, 2017
@Kikobeats
Copy link

Can you merge this @kimmobrunfeldt?

@Bazeloth
Copy link

I would really appreciate mergin this PR

@erosenberg
Copy link

Me too!

@Kikobeats
Copy link

I tried to be contributor of the repository for fix theses necessary PR's but @kimmobrunfeldt is not replying 😢

@erosenberg
Copy link

@Kikobeats - Bah, that sucks!!
I tried @sebacruz 's repo and ran into errors regarding importing isEqual from lodash.
It appears somehow it's looking for a package isequal instead of isEqual...

@sebacruz
Copy link
Contributor Author

sebacruz commented Nov 15, 2017

@erosenberg I updated the isEqual package name match the lodash/isEqual file, can you test if it's working now?

@erosenberg
Copy link

erosenberg commented Nov 15, 2017

@sebacruz - looks good now, thanks!!
I've just added your repo to my package.json until this one gets updated accordingly.

@Kikobeats
Copy link

Kikobeats commented Nov 16, 2017

What do you think create a fork package of this?

something like: https://www.npmjs.com/package/react-bar-progress

This situation is so tidious

@Jivings
Copy link

Jivings commented Nov 17, 2017

I've forked this repo here: https://github.com/squarecat/react-progressbar.js and it's now working in my React 16 project.

I've applied the patch of this PR, and given the repo public push access, so if anyone wants to move over any of the other PRs then feel free.

It's published to npm under react-progress-bar.js. If this project becomes active again then I'll remove it.

@Kikobeats
Copy link

Thanks for your effort @Jivings!

I'm seeing another error related with this line. My code said:

Uncaught Error: Element ref was specified as a string (progressBar) but no owner was set. You may have multiple copies of React loaded. (details: https://fb.me/react-refs-must-have-owner).

I think this is the correct way to setup a ref node:
https://github.com/kimmobrunfeldt/react-progressbar.js/pull/18/files#diff-1c90ff38a08209f9ebd4d05d1e43358eR79

It's used by the Shape internal components:
https://github.com/kimmobrunfeldt/react-progressbar.js/pull/18/files#diff-1e9094ba61ef643007d82d726a1ade45R149

@Jivings
Copy link

Jivings commented Nov 17, 2017

@Kikobeats Yep you're right. I also had to follow the answer in this thread.

I think this is due to react-progressbar importing it's own version of React so that the version in your code sees the ref as belonging to a different owner.

The alias obviously forces both the imports to use the same React version.

@Kikobeats
Copy link

@Jivings hmmm I'm not sure. Probably the code should be write as ES6 using imports and be shipped using babel compiler to ensure module injection is working as expected.

I wrote a package using this pattern, you can check the code here: https://github.com/Kikobeats/react-img-atv

I'm going to try create a PR doing that

@Jivings
Copy link

Jivings commented Nov 17, 2017

Yep I agree. These are just workarounds for a component that hasn't been built to be particularly resilient to it's environment.

@mssngr
Copy link

mssngr commented Feb 17, 2018

Would love to use this library, but my project's React 16. Looking forward to this some day getting merged?

@Kikobeats
Copy link

@mssngr uses the @Jivings forks, it is working like a charm
https://github.com/squarecat/react-progressbar.js

Could be great release it as @squarecat/react-progressbar.js.

Feel free to use https://www.npmjs.com/package/react-bar-progress as well 🙂

@jmfurlott
Copy link

@mssngr @Kikobeats in the meantime you guys can just do:

npm install git://github.com/squarecat/react-progressbar.js.git

Would be nice for a proper merge though as this is fragile from @squarecat

@Jivings
Copy link

Jivings commented Feb 21, 2018

@jmfurlott I actually published the fork to npm so you can do;

npm install react-progress-bar.js

@mssngr Unfortunately it looks like this project has been abandoned, but if anyone wants to contribute to the fork then let me know and I'll just grant write access.

@kimmobrunfeldt
Copy link
Owner

I'm sorry that I haven't been able to keep up with the maintenance. If @Jivings or others would be interested to help with this repo, I'm totally open to give access.

@kimmobrunfeldt kimmobrunfeldt merged commit 8ffd06c into kimmobrunfeldt:master May 28, 2018
var style = this.props.containerStyle;
var className = this.props.containerClassName;
render() {
const {style, className} = this.props;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sebacruz should be containerStyle and containerClassName

const { containerStyle, containerClassName } = this.props;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened PR for this. #32

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uncaught Error: addComponentAsRefTo(...): Only a ReactOwner can have refs.
10 participants