score:1
Accepted answer
the solution to your problem would be best solved by changing the shape or your state to something like this:
[
{
type: 'konvaimage',
item: <konvaimage image={image}/>
},
{
type: 'text',
item: '....'
},
...
]
then you do this:
switch(nodes.type) {
case 'text':
...
case 'konvaimage':
...
etc...
}
Source: stackoverflow.com
Related Query
- How do you get the Tag from a React Component
- I can not get the state from react router Link component using useLocation. So how can I pass it?
- how to get a Component variable from another component but their both in the same file React
- How to get the value from button group in react component
- how to get the data from child component in stepper in react material ui?
- how to get the data from a component within a form in react
- How do I get the value from a React Img component
- React : how to get input value from one component to make the ajax call in another component?
- How to get the data from dropdown component in React and update state?
- Making an HTML string from a React component in background, how to use the string by dangerouslySetInnerHTML in another React component
- How to get the data from React Context Consumer outside the render
- How to get refs from another component in React JS
- How to initialize the react functional component state from props
- How to pass the match when using render in Route component from react router (v4)
- How to update the state of a sibling component from another sibling or imported component in REACT
- How can I get a variable from the path in react router?
- How to get value from a react function within a react component
- How to get the react component instance corresponding to event.target element in a click handler?
- react - how do I get the size of a component child elements and reposition them
- How does React know the component is removed from the DOM?
- How to get the DOM node from a Class Component ref with the React.createRef() API
- How do you get the height of a stateless functional component that's a child?
- How do I sync state from the DOM to my React Component in an Isomorphic Application?
- How do you dynamically insert a React component into the DOM (for instance a dialog)?
- How to prevent React from re-rendering the whole component
- Using React how do I toggle the visibility of a nested component from a container component?
- How to call a component function on other component, but from the other component ? React
- How do I manage state on a React component that can have state changed from the parent or from events upon it?
- How can I use react useContext , to show data from context, in the same component
- React Native: How to add script tag in the component
More Query from same tag
- onTouchStart event triggering Parent OnClick Event in react js
- REDUX TOOLKIT ERROR - Uncaught Error: The slice reducer for key "cart" returned undefined during initialization
- Prevent onClick getting fired on load. I'm using the functional component on a React project
- Mapbox marker popups wont open/close individually
- Calling setState in jsdom-based tests causing "Cannot render markup in a worker thread" error
- React Native Webview with openlayers
- Change width and height of react-dropdown-tree-select component
- Exact Same Request Returns 200 to Postman but 404 to React App
- Set Flexbox Min Height To Fill Remaining Screen in Scrolling Container
- TSX React - How to index JSON API Data with multiple JSON Objects
- React-Router getUserConfirmation functionality issue
- How to handle multiple radio button groups in one component in reactjs?
- Why is my ref always null even though I'm setting it to a component
- unable to bind actions to component React Redux
- React setState doesnt update data immediately
- How to post 2 APIs at a time while doing on submit method using reactjs?
- How do I hide the border around Blueprint.js switch component?
- Netflix Falcor working together with Immutable.js?
- Formatting json data into table React.js
- Material UI Autocomplete default value of empty string
- Child component removed by parent still gets store change event
- Auto-completion : How to replace the input field of the Webchat with your own react-select element
- React Memory Leakage with typescript using google firestore and react router
- What does <Component render={({ state }) => {}} /> do in React?
- I can't fetch from external API in production
- How can I fetch data from Sanity
- reactjs, how to pass props at the class level
- Unable to change value of component programmatically using useState
- Next.js-express dynamic routing causes page reload
- React Function is not returning component after being called from onchange method