Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while updating property 'd' in shadow node of type: RNSVGPath #1

Open
darvi-sh opened this issue Sep 10, 2016 · 9 comments
Open

Comments

@darvi-sh
Copy link

Hey,

Thanks for the code!
First of all I'm new to react-native.

I'm trying to develop something like this: http://jsfiddle.net/soundar24/LpuLe9tr/3/
And your code seems the closest react-native I could work with.

I've imported CircularSlider, put the <CircularSlider> part and now I'm getting this error:
image

Line 49:

d={`M${startCoord.x} ${startCoord.y} A ${r} ${r} 0 ${value>180?1:0} 1 ${endCoord.x} ${endCoord.y}`}

I replaced it with another value d="M10 10" and it showed something correctly, that's how I concluded the error line.

@steveliles
Copy link
Owner

I'm guessing you didn't set the width and height props, and maybe others, e.g.

<CircularSlider width={250} height={250} meterColor='#ffa' textColor='#000' value={this.state.sliderValue} onValueChange={(value)=>this.setState({sliderValue:value})}/>

If there is a bug here its that I didn't specify the propTypes so you weren't forced to set them.

@darvi-sh darvi-sh reopened this Sep 17, 2016
@darvi-sh
Copy link
Author

Sorry for the close/open, accidentally clicked.

I used your code actually, it has all the props.
The error disappears only when I remove the d attribute in Path tag.
I'll try to explore more on your code and if possible post the answer here.

@arendjr
Copy link

arendjr commented Oct 25, 2016

I've had a similar problem, but after debugging it turned out the string contained invalid formatting ("NaN" and stuff). Maybe you're having a similar problem?

@ORESoftware
Copy link

ORESoftware commented Feb 3, 2017

@arendjr I see that NaN business also, anyone know why it could have made its way in there? Some division by zero surely

@arendjr
Copy link

arendjr commented Feb 3, 2017

@ORESoftware: You should probably check your

@arendjr
Copy link

arendjr commented Feb 3, 2017

Sorry, pressed the button accidentally (on mobile). What I meant was:

You should probably check your own application code. At least in my case I was the one accidentally inserting NaNs in the definition of the d attribute.

@ORESoftware
Copy link

Yeah, so d is here:

 <Surface width={graphWidth} height={graphHeight}>
                    <Group x={0} y={0}>
                        <Shape
                            d={linePath}   /// <<<<<<<<<<<<<<<<
                            stroke={Color.Orange}
                            strokeWidth={1}
                        />
                    </Group>
                </Surface>

the value for linePath is:

"MNaN,302Z"

LOL no idea where that data is coming from, must be some arithmetic problem

@djohnkirby
Copy link

I had this problem and fixed it by restarting the packager.

@Laurensdc
Copy link

Restarting the packager didn't work for me, I did a cleanup of node_modules and restarted packager & emulator.

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

No branches or pull requests

6 participants