Code Monkey home page Code Monkey logo

react-mobx-demo's Introduction

React-Mobx Zhihu Daily

GitHub package version GitHub license Travis Github All Releases

中文🇨🇳

If something doesn’t work, please file an issue.

Tech used

  • React v15
  • Mobx v2.5
  • Mobx-react
  • React-router v4
  • mobx-react-router v4
  • antd v2
  • react-scripts
  • create-react-app
  • ……

How to run

  • Install: npm install(yarn)
  • Run: npm start Then open http://localhost:3000 to see the app.
  • Build: npm run build

Tree

├─config
├─src
│  ├─assets
│  │  ├─img
│  │  └─styles
│  ├─compontens
│  ├─config
│  ├─routes
│  ├─store
│  └─utils
└─build

API

This app ues the [ZhiHu Daily API], go to see the API.

Get data

  • Use the Yahoo service cross-domain
YAHOO:'https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20json%20where%20url=%22',
YAHOO_SUFFIX:'%22&format=json'

How to use Mobx(Decorators)

I use the creat-react-app to creat my app.

You can add the transform-decorators-legacy yourself in node_modules/react-scripts/config/babel.dev.js and babel.prod.js,like this:

  • add this code into presets:
require.resolve('babel-preset-stage-1'),
require.resolve('babel-preset-es2015')
  • add this code into plugins first line:
require.resolve('babel-plugin-transform-decorators-legacy'),

react-mobx-demo's People

Contributors

hancoson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

react-mobx-demo's Issues

How to resolve the mobx warning

I use create-react-app build my project. But when I import mobx-react and use <provider>, I get the warning: [mobx] Warning: there are multiple mobx instances active.This might lead to unexpected results.
Need your help, thanks.

node v8.11 npm 5.6

npm install
npm WARN deprecated [email protected]: We're super ???? excited that you're trying to use ES2017+ syntax, but instead of making more yearly presets ???? , Babel now has a better preset that we recommend you use instead: npm install babel-preset-env --save-dev. preset-env without options will compile ES2015+ down to ES5 just like using all the presets together and thus is more future proof. It also allows you to target specific browsers so that Babel can do less work and you can ship native ES2015+ to user ???? ! We are also in the process of releasing v7, so please give http://babeljs.io/blog/2017/09/12/planning-for-7.0 a read and help test it out in beta! Thanks so much for using Babel ????, please give us a follow on Twitter @babeljs for news on Babel, join slack.babeljs.io for discussion/development and help support the project at opencollective.com/babel
npm WARN deprecated [email protected]: ???? Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
npm WARN deprecated [email protected]: ???? Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
npm WARN deprecated [email protected]: ???? Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN tar ENOENT: no such file or directory, lstat 'd:\dev\react-mobx-demo\node_modules.staging\fsevents-431f3858\node_modules\node-pre-gyp\lib\util'
npm WARN tar ENOENT: no such file or directory, lstat 'd:\dev\react-mobx-demo\node_modules.staging\fsevents-431f3858\node_modules\node-pre-gyp'
npm WARN tar ENOENT: no such file or directory, open 'd:\dev\react-mobx-demo\node_modules.staging\fsevents-431f3858\node_modules\node-pre-gyp\lib\util\s3_setup.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\dev\react-mobx-demo\node_modules.staging\fsevents-431f3858\node_modules\node-pre-gyp\lib\util\versioning.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\dev\react-mobx-demo\node_modules.staging\fsevents-431f3858\node_modules\node-pre-gyp\LICENSE'
npm WARN tar ENOENT: no such file or directory, open 'd:\dev\react-mobx-demo\node_modules.staging\fsevents-431f3858\node_modules\node-pre-gyp\package.json'
npm WARN tar ENOENT: no such file or directory, open 'd:\dev\react-mobx-demo\node_modules.staging\fsevents-431f3858\node_modules\node-pre-gyp\README.md'
npm WARN tar ENOENT: no such file or directory, open 'd:\dev\react-mobx-demo\node_modules.staging\fsevents-4728b022\node_modules\hawk\images\hawk.png'
npm WARN tar ENOENT: no such file or directory, open 'd:\dev\react-mobx-demo\node_modules.staging\fsevents-4728b022\node_modules\hawk\images\logo.png'
npm WARN tar ENOENT: no such file or directory, open 'd:\dev\react-mobx-demo\node_modules.staging\fsevents-431f3858\node_modules\once\LICENSE'
npm WARN tar ENOENT: no such file or directory, open 'd:\dev\react-mobx-demo\node_modules.staging\fsevents-431f3858\node_modules\once\once.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\dev\react-mobx-demo\node_modules.staging\fsevents-431f3858\node_modules\once\package.json'
npm WARN tar ENOENT: no such file or directory, open 'd:\dev\react-mobx-demo\node_modules.staging\fsevents-431f3858\node_modules\once\README.md'
npm WARN tar ENOENT: no such file or directory, lstat 'd:\dev\react-mobx-demo\node_modules.staging\fsevents-431f3858\node_modules\os-homedir'
npm WARN tar ENOENT: no such file or directory, open 'd:\dev\react-mobx-demo\node_modules.staging\react-scripts-24713511\node_modules\babel-plugin-syntax-async-functions\package.json'
npm WARN tar ENOENT: no such file or directory, open 'd:\dev\react-mobx-demo\node_modules.staging\react-scripts-24713511\node_modules\babel-plugin-syntax-async-functions.npmignore'
npm WARN tar ENOENT: no such file or directory, open 'd:\dev\react-mobx-demo\node_modules.staging\react-scripts-24713511\node_modules\babel-plugin-syntax-async-functions\README.md'
npm WARN tar ENOENT: no such file or directory, open 'd:\dev\react-mobx-demo\node_modules.staging\react-scripts-24713511\node_modules\babel-plugin-transform-es2015-computed-properties\lib\index.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\dev\react-mobx-demo\node_modules.staging\react-scripts-24713511\node_modules\babel-plugin-transform-es2015-sticky-regex\package.json'
npm WARN tar ENOENT: no such file or directory, open 'd:\dev\react-mobx-demo\node_modules.staging\react-scripts-24713511\node_modules\babel-plugin-transform-es2015-sticky-regex.npmignore'

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.