May 2017
Intermediate to advanced
388 pages
7h 30m
English
The first step is to install a package to support the CSS modules:
>> meteor add nathantreid:css-module.
In the components folder, create a NavBar subdirectory where we'll create the NavBar component.
In the index.js file , we will import and export the component:
import NavBar from './NavBar'export default NavBar;
We will define the NavBar as a presentational component that will get an array of links as props and render them. As a presentational component, that is the only thing it will do:
import React from 'react'import {Link} from 'react-router'import styles from './style.css'class NavBar extends React.Component { constructor(props) { super(props); } render() { const {links} = this.props; return (Read now
Unlock full access