freeCodeCamp/curriculum/challenges/chinese/03-front-end-libraries/react-and-redux/moving-forward-from-here.ch...

2.3 KiB
Raw Blame History

id title challengeType isRequired videoUrl localeTitle
5a24c314108439a4d403614a Moving Forward From Here 6 false 从这里前进

Description

恭喜你完成了React和Redux的课程。在继续之前最后一项值得指出。通常您不会在这样的代码编辑器中编写React应用程序。如果您在自己的计算机上使用npm和文件系统这个挑战可以让您一瞥语法的样子。代码看起来应该类似除了使用import语句(这些语句提取了在挑战中为您提供的所有依赖项)。 “使用npm管理包”部分更详细地介绍了npm。最后编写React和Redux代码通常需要一些配置。这可能很快变得复杂。如果您有兴趣在自己的机器上进行实验可以配置Create React App并准备就绪。或者您可以在CodePen中启用Babel作为JavaScript预处理器将React和ReactDOM添加为外部JavaScript资源并在那里工作。

Instructions

记录消息'Now I know React and Redux!'到控制台。

Tests

tests:
  - text: 消息<code>Now I know React and Redux!</code>应该登录到控制台。
    testString: 'assert(editor.getValue().includes("console.log("Now I know React and Redux!")") || editor.getValue().includes("console.log(\"Now I know React and Redux!\")"), "The message <code>Now I know React and Redux!</code> should be logged to the console.");'

Challenge Seed

// import React from 'react'
// import ReactDOM from 'react-dom'
// import { Provider, connect } from 'react-redux'
// import { createStore, combineReducers, applyMiddleware } from 'redux'
// import thunk from 'redux-thunk'

// import rootReducer from './redux/reducers'
// import App from './components/App'

// const store = createStore(
//   rootReducer,
//   applyMiddleware(thunk)
// );

// ReactDOM.render(
//   <Provider store={store}>
//     <App/>
//   </Provider>,
//   document.getElementById('root')
// );

// change code below this line

Solution

// solution required