Beginning React by Andrea Chiarelli

Beginning React by Andrea Chiarelli

Author:Andrea Chiarelli [Andrea Chiarelli]
Language: eng
Format: epub
Publisher: Packt Publishing
Published: 2018-07-24T21:00:00+00:00


This component defines a list of wines, names, and descriptions.

We want to integrate our Catalog component with the wine list. Since we have created the ProductList component, we can use it as a tag in the JSX markup of the Catalog component, as shown here:

import React from 'react';

import ProductList from './ProductList';

class Catalog extends React.Component {

render() {

return <div>

<h2>Catalog</h2>

<ProductList />

</div>;

}

}

export default Catalog;

As you can see, we simply imported the ProductList component in order to make it available inside the Catalog component's module, and we used the ProductList tag where we wanted the wine list to appear.

Run npm start to launch the application. The resulting page will look like this:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.