Cannot Read Property Parentnode of Null Chromecast

What's the problem TypeError: Cannot read property 'parentNode' of cipher?

Here's the screen code:
5ddc28f877dbf391256791.png
Clicking on any of the two links in the console gives this error - TypeError: Cannot read property 'parentNode' of nix
but in the browser everything works fine and the links goes.
Use React-router-dom

1 answer

Apr 2d twenty at xvi:xvi

Solution

Evidence lawmaking router

5ddc40ae621d0290789723.png - alfonzo_Abbott commented on April 2nd 20 at 16:19

@Imani, full code religion does non allow to throw? What kind of Router are you using?
import { Router } from 'react-router-dom';
or

                  import { BrowserRouter equally Router } from 'react-router-dom';                

? - barrett_Hil commented on April 2nd 20 at xvi:22

In Full general, if the first option - replace the 2nd, it should work. If the second option - that throw off the code in the sandbox, look in fact - barrett_Hil commented on April 2nd xx at 16:25

@Sammy26,

                  import { useHistory, BrowserRouter as Router, Switch Route Link } from 'react-router-dom';  function App() {   render ( <Router> <principal>  <Header screenHandler={()=>{}} />  <Switch>  <Road exact path='/'>  <BlogScreen posts={Posts} /> </Route>  <Route path='/postal service'>  <PostScreen /> </Road>  <Route path='/edit'>  <EditScreen onAddPostClick={createNewPost} onSavePostClick={changePost} /> </Road> </Switch> </master> </Router> ); }  export default App;                

- alfonzo_Abbott commented on April 2nd 20 at 16:28

@Imani, code MainButton place - barrett_Hil commented on April 2d twenty at xvi:31

@Sammy26,

                  import React from 'react'; import styled from 'styled-components';  const StyledButton = styled.push`  padding: 10px 20px;  font-size: 15px;  border: none;  groundwork-color: #fff;  color: #000; `;  const MainButton = ({children onButtonClick}) => (  <StyledButton onClick={onButtonClick}>{children}</StyledButton> );  consign default MainButton;                

- alfonzo_Abbott commented on April second xx at 16:34

@Imani, the problem must be in the button, remove information technology from the code and all should be apprx. See the method that triggered the onClick, something is wrong. Well, judging by the lawmaking you exercise not transfer whatever method, just call it when y'all click - barrett_Hil commented on Apr second 20 at 16:37

@Sammy26, no, button, I tried to remove, did not aid, even when I inverse the url using history.push button() the page is changed but this fault still pop out. - alfonzo_Abbott commented on April second 20 at 16:twoscore

A method that I laissez passer, onButtonClick - alfonzo_Abbott commented on April 2nd 20 at 16:43

@Imani, in that location you the method to get, merely yous're not. Your button is rendered in the component Header, but no method in it, yous're not. That is, your method in a push component === undefined. Try instead of simply paste () => {console.log('click')}

If the problem persists - throw off the link to the repository - barrett_Hil commented on Apr 2nd twenty at 16:46

@Imani, I take no errors either with the push button or without - barrett_Hil commented on April second 20 at 16:52

@Sammy26, then this is exactly the conflict that can throw off package.json? - alfonzo_Abbott commented on April 2nd xx at sixteen:55

@Imani, I have it from your repository, respectively, the same - barrett_Hil commented on April 2nd twenty at 16:58

@Sammy26, and and so what could be the problem, whatever thought? - alfonzo_Abbott commented on Apr 2nd twenty at 17:01

@Imani, download your repository from github, maybe this will eliminate the error. But in General, the error reports that something is trying to read property parentNode of undefined at/nothing node
Perhaps even in some place of the code you are trying to work with the property DOM node, but it is not - barrett_Hil commented on April 2d 20 at 17:04

@Sammy26, I yet retrieve information technology'due south a version conflict, simply at starting time I generated project using the create-react-app and then I installed react-router-dom, and you're all prepare at a time... and I recollect that y'all create-react-app have installed some package to some other version which is uniform with react-router-dom, practice not know if the create-react-app automatically checks for conflicting dependencies and selects the version when initializing. In any case, thank you to you, this question volition be useful to someone.
I, in plow, removed the react-router-dom and fabricated routing through the global state, the awarding is not large. - alfonzo_Abbott commented on April second twenty at 17:07

Find more questions past tags JavaScriptReact

hoffmanclarm1999.blogspot.com

Source: https://helperbyte.com/questions/463444/whats-the-problem-typeerror-cannot-read-property-parentnode-of-null

0 Response to "Cannot Read Property Parentnode of Null Chromecast"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel