Code Monkey home page Code Monkey logo

react-modular-code's Issues

Code errors

  • Inside of the Named Exports section, directly above the Imports header, the code block dropped the function declaration prior to the values() function definition.

  • The last code block in the import section (directly above Importing Node Modules) tries to import gryffMascot and alias it to mascot, but the syntax is wrong. It is currently written

import { mascot as gryffMascot } from './houses/Gryffindor.js';

but it should be

import { gryffMascot as mascot} from './houses/Gryffindor.js'

The function in houses/Gryffindor.js is called gryffMascot, not mascot. To alias it to another name, you want to put <nameUsedInTheExportFile> as <newNameAlias>.

Reorganize these beginning lessons

It really seems like this lesson would be better served right at the beginning of the React module. I understand that the intent with the previous labs may have been to "show all the cool things you can do with React", but Import and Export should have been explained before that. Please consider a reorg of these labs.

Components are not a feature React introduced

React makes the modularization of code easy by introducing the component structure.

This is inaccurate and gives students the impression that components don't exist elsewhere; it does, it's just that this curriculum didn't happen to teach it in that section. It's a vanilla JS feature that can totally be used sans-React (as some of us did, in our JS projects).

Alternative:

React makes use of JavaScript's component structure, which we haven't been introduced to yet. It looks something like this:

Issue #6 was closed but was not entirely fixed

Issue #6 has not been entirely fixed. Specifically, bullet point 1 which says

Inside of the Named Exports section, directly above the Imports header, the code block dropped the function declaration prior to the values() function definition.

is unfixed. The code block above the Import header (about 3/4 of the way down the page) still has a dropped function declaration before the values() function

There's a typo when importing from HagridsHouse.js

Hello,

In the Export section, the code for importing the whosehouse function seems to be incorrect.

The source file is HagridsHouse.js,
BUT,

the in the Hogwarts.js file, it's being imported from:
import whoseHouse from './house.js'

Right?
Mentioning it, as it could be confusing for someone just seeing import/export code for the first time.

On the other hand?

The phrase "on the other hand" makes the following very confusing. I'm guessing one of the "exports" has to be changed to "imports," but I'm not sure:

"With named exports, we can export multiple pieces of code from within a module, allowing us to call on them explicitly when we import.

Named exports, on the other hand, allow us to export several specific things at once:"

Thank you.

Should mascot() here be gryffMascot()?

import {function()} from
import {function()} from allows us to grab a specific function by name, and use that function within the body of a new module.

We're able to reference the function imported by its previously declared name, or rename it inside of our import statement.

// src/Hogwarts.js
import { colors } from './houses/Gryffindor.js'
import { mascot as gryffMascot } from './houses/Gryffindor.js'

colors()
// > 'Scarlet and Gold'

mascot()
// > 'The Lion'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.