Giter VIP home page Giter VIP logo

react-demos's Issues

demo 11 里面的 this.isMounted 的作用是什么?

阮老师你好。我想请教下这一段里面的this.isMounted的作用。

componentDidMount: function() {
$.get(this.props.source, function(result) {
var lastGist = result[0];
if (this.isMounted()) {
this.setState({
username: lastGist.owner.login,
lastGistUrl: lastGist.html_url
});
}
}.bind(this));
},

看README的描述

did methods which are called right after something happens.

componentDidMount这个钩子调用的时候 this.isMounted应该总是为true吧。那么这个判断是不是多余的。

Create CI Build the deploys to github pages

It would be good to have a build setup for this project, where code is linted and deployed to the github pages.

I work on this open-source build tool called earthly and I could do the work to set this up with GitHub Actions and earthly. Would that be useful?

demo11、12ajax请求问题

请问在Demo11、12,使用jquery发起的ajax请求,是json请求不是jsonp请求,为什么同源策略不起作用,浏览器仍正常发送

Please correct the name "HelloMessage" on wrong case

//wrong

var HelloMessage = React.createClass({ // should be helloMessage
  render: function() {
    return <h1>
      Hello {this.props.name}
    </h1><p>
      some text
    </p>;
  }
});

// correct

var HelloMessage = React.createClass({
  render: function() {
    return <div>
      <h1>Hello {this.props.name}</h1>
      <p>some text</p>
    </div>;
  }
})

Wrong class name?

I read your article.
It's very cool.

But maybe something is incorrect in the Demo04: Define a component

Maybe you want to give an example to show that the first lower case will generate an error.
But in your article, two examples are both start with the BIG H.

I feel that isn't your original proposal

React Demo's with Babel.js

Hi,

Curious if you are accepting PR's for updated demo's using babel.js? or if you plan to update repo using babel.js

how to add css file to the component

I tried to import the corresponding css file to the LogIn component like this:

import '../css/login.css';
import React from 'react';
const LogIn = React.createClass(.......)

But encountered with this error:

C:\Users\username\Desktop\APPStore>node server.js
module.js:471
    throw err;
    ^
Error: Cannot find module '../css/login.css'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\LIN SIYIN\Desktop\AppStore\APPStore\components\LogIn.js:5:1)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

How can I solve it? Thanks a lot!

And my other question is how can I reference to another component in the button onClick() event? The reason Why I am trying to do this is because I want to direct to another page when click the button.

demo06 输出正确呢

输出是123呢不是那个报错的Warning: Failed propType: Invalid prop title of type number supplied to MyTitle, expected string

求教

执行第三步报错

在第三步报错了,
demo13/src/server.js:19
<body>
^
SyntaxError: Unexpected token <

$npm is not recognized as an internal or external command

After I git clone the ssh from github page and successfully installed the package, and I can open the file folder in Atom, I can not use the $npm install -g babel. I'm using windows 10 system.

The error message goes like this:

User\Document\react-demos $npm install -g babel
'$npm' is not recognized as an internal or external command,
operable program or batch file.

New to JavaScript but rush to a final. Thanks in advance for your reply!

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.