i had created card component and i called in my ProductPage.js after that i am getting error like Uncaught DOMException: Failed to execute ‘createElement’ on ‘Document’: The tag name provided (‘/static/media/Card.c3b0a67ff849f2bda062.JS’) is not a valid name. initially it was div and i change to card after that i am getting above error if changed div then it is working fine
Tag: react-component
Returning value from React child component
I am beginner in React so I apologize if this is a basic question. I am trying to build an online Sudoku grid using ReactJS but I am unable to render the digits in the field. I have made two components one being the Sudoku.js which renders the complete sudoku block and other being Node.js which consists of an input
How to use useRef hook properly in react Functional Component?
I have a JavaScript snippet and I’m trying to implement the same in react. Here is the snippet. const nav = document.querySelector(‘.nav’); window.addEventListener(‘scroll’, fixNav); function fixNav()…
having n states in react, assuming that n won’t be received in props
How could I have n states in a React component Assuming that the component won’t receive this n value in any props, is something that it will get from a database Using useState will create the state, …
defining a function to pass it as props, but I get a compiling error
I have a react component that is trying to pass a function to another component, the problem is that I’m not being able to define the function, it throws a compiling error export default function App()…
How to add two states to my component inputText in OnChangeText
I need to add two parameters to my onChangeText, but I don’t know how I can do that, My component is: handleChangePhone = (value) => { this.setState(prevState => ({ phone: normalizePhone(…
Trying to add a detail product component. React-router
I have a component products which lists every product in the /Productsurl. I’m trying to make another component Detail that displays specific product in the browser. This is the URL I’ve been trying …
Converting componentDidMount into useEffect
I am trying to learn React hooks, and trying to convert existing codebase to use hooks, but I am confused. Is it normal to set state inside useEffect? Would I be causing the dreaded infinite loop if I …
Material-ui drawer width issue
I’m facing an issue with material-ui drawer. I’ve changed the width of the drawer container which causes a a problem . The drawer remains a little inside the page and visible but I don’t want to make it visible on the page while I haven’t clicked the button. It might be having an issue with the transform attribute now. So
How to add custom html attributes in JSX
There are different reasons behind it, but I wonder how to simply add custom attributes to an element in JSX?