oblador / react-native-progress

Progress indicators and spinners for React Native
MIT License
3.63k stars 516 forks source link

Arc renders with a black fill #234

Closed petrbela closed 1 year ago

petrbela commented 3 years ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch react-native-progress@5.0.0 for the project I'm working on.

On web, Circle and CircleSnail render with a black fill. See https://snack.expo.dev/@petrbela/react-native-progress-fill

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-progress/Circle.js b/node_modules/react-native-progress/Circle.js
index 79f0a9e..879e3b4 100644
--- a/node_modules/react-native-progress/Circle.js
+++ b/node_modules/react-native-progress/Circle.js
@@ -168,6 +168,7 @@ export class ProgressCircle extends Component {
           )}
           {border ? (
             <Arc
+              fill={fill}
               radius={size / 2}
               startAngle={0}
               endAngle={(indeterminate ? endAngle * 2 : 2) * Math.PI}
diff --git a/node_modules/react-native-progress/Shapes/Arc.js b/node_modules/react-native-progress/Shapes/Arc.js
index f913a56..acff1f0 100644
--- a/node_modules/react-native-progress/Shapes/Arc.js
+++ b/node_modules/react-native-progress/Shapes/Arc.js
@@ -86,6 +86,7 @@ export default class Arc extends Component {
     return (
       <Path
         d={path}
+        fill="none"
         strokeLinecap={strokeCap}
         strokeWidth={strokeWidth}
         {...restProps}

This issue body was partially generated by patch-package.

a-luengen commented 3 years ago

I had the same issue with v5.0.0 on my Android device. Sadly your solution did not remove the black fill in the arc.

Instead a simple workaround helped me: Set fill="#00000000" and it gets transparent again.

harshilmobmaxime commented 1 year ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch react-native-progress@5.0.0 for the project I'm working on.

On web, Circle and CircleSnail render with a black fill. See https://snack.expo.dev/@petrbela/react-native-progress-fill

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-progress/Circle.js b/node_modules/react-native-progress/Circle.js
index 79f0a9e..879e3b4 100644
--- a/node_modules/react-native-progress/Circle.js
+++ b/node_modules/react-native-progress/Circle.js
@@ -168,6 +168,7 @@ export class ProgressCircle extends Component {
           )}
           {border ? (
             <Arc
+              fill={fill}
               radius={size / 2}
               startAngle={0}
               endAngle={(indeterminate ? endAngle * 2 : 2) * Math.PI}
diff --git a/node_modules/react-native-progress/Shapes/Arc.js b/node_modules/react-native-progress/Shapes/Arc.js
index f913a56..acff1f0 100644
--- a/node_modules/react-native-progress/Shapes/Arc.js
+++ b/node_modules/react-native-progress/Shapes/Arc.js
@@ -86,6 +86,7 @@ export default class Arc extends Component {
     return (
       <Path
         d={path}
+        fill="none"
         strokeLinecap={strokeCap}
         strokeWidth={strokeWidth}
         {...restProps}

This issue body was partially generated by patch-package.

this also work for me to solved the issue of progress circle black background

gabrielafeijo commented 1 year ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch react-native-progress@5.0.0 for the project I'm working on.

On web, Circle and CircleSnail render with a black fill. See https://snack.expo.dev/@petrbela/react-native-progress-fill

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-progress/Circle.js b/node_modules/react-native-progress/Circle.js
index 79f0a9e..879e3b4 100644
--- a/node_modules/react-native-progress/Circle.js
+++ b/node_modules/react-native-progress/Circle.js
@@ -168,6 +168,7 @@ export class ProgressCircle extends Component {
           )}
           {border ? (
             <Arc
+              fill={fill}
               radius={size / 2}
               startAngle={0}
               endAngle={(indeterminate ? endAngle * 2 : 2) * Math.PI}
diff --git a/node_modules/react-native-progress/Shapes/Arc.js b/node_modules/react-native-progress/Shapes/Arc.js
index f913a56..acff1f0 100644
--- a/node_modules/react-native-progress/Shapes/Arc.js
+++ b/node_modules/react-native-progress/Shapes/Arc.js
@@ -86,6 +86,7 @@ export default class Arc extends Component {
     return (
       <Path
         d={path}
+        fill="none"
         strokeLinecap={strokeCap}
         strokeWidth={strokeWidth}
         {...restProps}

This issue body was partially generated by patch-package.

This worked for CircleSnail but not Circle. Changing to fill="#00000000" resolved the issue.

fzchriha commented 1 year ago

Hello I tried using CircleSnail and Circle and both the solutions above have not worked :(

Isissss commented 1 year ago

Hello I tried using CircleSnail and Circle and both the solutions above have not worked :(

Be sure you have the react-native-svg package installed :)

cngvc commented 1 year ago

In my case: Circle is still black:

LaiviF commented 1 year ago

Thanks cngvc downgrading react-native-svg using expo 49 worked for me

oblador commented 1 year ago

Should be fixed in 5.0.1