-
Notifications
You must be signed in to change notification settings - Fork 93
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
Uncaught TypeError: Cannot read property 'replaceChild' of null(...) #14
Comments
Probably implementing shouldComponentUpdate would prevent this from happening. In my case I wrapped the component with another component that ensures the component is only updated when its props change. |
@mikeriley131 see if the latest version (> 2.02) solves your issue? (Commit e946dc2). |
Still an issue here on 2.1.1 Updates of the path based on props causes this issue. |
Thanks for that extra info @Montaldo. I've got an idea of what changes I need to make, so once they're done I'll let you know. |
@mikeriley131 @nikoskleidis @Montaldo Just published |
Hi @tanem, thanks a lot for creating and supporting your nifty package! I use it for toolbar icons and want icon to change color when it's "active". I can set I use Simple test to run: <div onClick={() => this.setState({active: !this.state.active})}>
<ReactSVG path={alignmentLeftIcon} style={{color: this.state.active ? "#a33" : "#000"}}/>
</div> Error:
|
Thanks @viniychuk. Think I can fix this by moving more of the DOM manipulation away from React. Will repost when I've got something working ⌛️ |
@viniychuk just released |
@tanem Thanks so much, it works like a charm now! |
@tanem I'm still getting this error in 2.1.10 Here is what my component definition looks like:
|
Actually, maybe mine is a little different. The call stack is different, but similar:
|
If it helps, the SVG does render to the DOM, I just get that error as well. |
Thanks @duro, will get back to ya once I've had the chance to look properly 👍 |
@duro I haven't been able to recreate your issue using an isolated example, are you able to provide more context? FWIW, it does look similar to the error output we saw many versions ago, so you might just want to make sure you are indeed pulling in the correct version of this library. Maybe something along the lines of:
Also, this may or not be useful to you, but there's a JSBin I sometimes play with that uses the UMD builds: http://jsbin.com/cicixuyofu/edit?html,js,output. Should probably link to it via the README at some point 😏 |
Having this issue too. Occurs on first render. element seems to have no parentNode on the first injectElement call |
Thanks @astandrik. Published |
@duro @astandrik just published |
Can't say it helped a lot sorry. I'm doing the following:
P.S. Icons work as expected but the error makes me feel a bit uncomfortable
|
Thanks @astandrik, think I managed to recreate your issue (or at least a very similar one 😅). Have released 2.1.17, can you let me know if that's any better now? |
I had a similar issue as @astandrik's earlier today, but downloaded 2.1.18 and am no longer receiving the type error. Thanks! |
Great, thanks for reporting back @kathrynreagan 💪 |
Now everything works great. Thanks for your efforts! |
@tanem Hello tanem, i have seen the discussion above, butI'm still getting this error in 7.0.1 "Cannot read property 'replaceChild' of null" |
Hey @Dlpan, thanks for the report. Since this issue you're commenting on is quite old now, I think it's worth creating a new issue? Any further information you can provide, such as code snippets, would be helpful too |
Getting this error when using this package. Possible conflict with the YouTube Player API?
The text was updated successfully, but these errors were encountered: