score:0
You can use Nested Object Destructuring for this purpose like this
const {offerAction:{OfferActionCriteria,offerActionPost:{url,name,id,postMethod}}} =
this.props;
to access the OfferActionCriteria object. inside renderAdvertiserForm function.
renderAdvertiserForm = () => {
const {offerAction:{OfferActionCriteria,offerActionPost:{url,name,id,postMethod}}} = this.props;
console.log(OfferActionCriteria);
return (
<form>
<ModalHeader toggle={this.toggleSuccess}>
{name} - <em>{id}</em>
</ModalHeader>
<ModalBody>
<div>
<Row>
<Col lg={6}>
<Label>Post Name</Label>
<Field
name='name'
type='text'
component={renderField}
/>
</Col>
<Col lg={6}>
<Label>Post Method</Label>
{postMethod}
</Col>
</Row>
<br />
<Row>
<Col lg={12}>
<Label>URL</Label>
{offerAction.url}
</Col>
</Row>
<br />
</div>
<br />
</ModalBody>
</form>
);
};
Source: stackoverflow.com
Related Query
- How to get data from an object with arrays/strings and then pass that data to a React component
- How to pass variable to graphql from method when onClick with button and get it's return data back?
- How can I match data from an object and pass it as props to another component that displays dynamically?
- How can i get array of object from this data for state and count in reactjs
- How do I pass the text data from firestore inside the expandable row and get the document ID to be passed inside the setState?
- How can I format an excel file with empty rows to have nested arrays and match a JSON object that I need to render?
- In React How to pass object using history.push from a component to child component and read data
- How to check and return value of state object array and use that to identify which object to take data from
- How to fetch data from API and then pass it to another component in react after it is fully loaded?
- How to get a single data element from the database with Redux and React?
- How to get data from Api first and then call the my function?
- How to get props and pass data from child in reactjs?
- How to get old state of an array that is inside and object with spread operator in Redux
- How can I store the data I get from a Promise back into an object with the same key it came from?
- I'm trying to delete an object from an array and the response I get is that the data is undefined
- How to update redux store tree and then update another tree with data from first?
- How to retrieve different type of data from JSON object array and play with it?
- how to deal with object when while fetching data it is initially null and then it gets filled with data
- How to map through an Array of object with the same data on some object and get it displayed once and also get other properties
- how to get spesific data from api with axios and react js?
- How to get images from e.target.files[0] by input id so that i can set the state of images and then post it via axios
- How to get object value from an array in the local storage and compare it with a new value?
- How to pass in memory json data from parent component to child component in react js and to display that in tabular form in child component
- How to get data from object and put the this data in a linechart component
- How to find an object from recursive array of objects that is matching with the id using javascript and react?
- How to pass both image file and object with values from React and retrieve it on the Node.js (express) server?
- How to get variable colors from database with Axios and then apply them in Scss - ReactJs
- Get object data and target element from onClick event in react js
- React.js: loading JSON data with Fetch API and props from object array
- how to pass object as params in Router.push() in nextjs and access that object in other component
More Query from same tag
- React Router Dom v4 handle browser back button
- Not working handleChange when copy & paste in React
- React 16 upgrade - select lists return Object Object
- unsure why res.send not sending my object to the front end
- No application encryption key has been specified (react)
- React How to fix "Slide to Unlock" Error Message?
- How to convert React JSX material ui elements to string
- How can i add more searchable options to React-Select?
- How to pass an object as props to a child Functional Component in React.js?
- Passing props in React jsx as generics
- Unexpected token with Webpack and React
- React Testing Library Invariant failed: You should not use <Route> outside a <Router>
- How to call an individual modal box component in react?
- React, JS - best practices for setState()
- React material UI autocomplete is not working with the formik
- How to import jQuery UI using ES6/ES7 syntax?
- Arranging an Image and a Component on the same line
- how to split the values in map array in react
- I am getting a unique key prop warning when i have a unique key
- Passing changing parameters from a hook to setInterval()
- React TypeError: Cannot read property 'length' of undefined
- Adding full screen background in react-slick carousel
- In React, how to add a URL "string" as an object's property, from a Link or other component
- I am getting "expected ';' " error in my class componet code in react 16.3.1
- How to prevent page reload after uploading file to dev server?
- Highlight item onClick - React.js
- Cannot configure a React Pre Hook with parameters passed to "npm start"
- React onSubmit placement
- How to change numbers in material ui stepper to alphabet like a,b,c,d
- Show protected image from API to Next.js client in an img tag