demo of whinepad3
is available at https://www.whinepad.com/
stoyan / reactbook Goto Github PK
View Code? Open in Web Editor NEWfiles accompanying the book "React: Up and Running"
files accompanying the book "React: Up and Running"
demo of whinepad3
is available at https://www.whinepad.com/
Hey Stoyan, I'm reading chapter 7 of your React book and it's really hard to make the code working (especially for a novice in all that fancy instruments), some libraries are obsolete, some configs are not working, though I've managed to pull things together but it took a lot of time. So I thought maybe it would be useful for other folks to see real working examples without wasting a lot of time (though it was useful for me)
If you don't mind I'll post a link to working examples of chapter 7 (without real tests yet) here
https://github.com/ekonoval/reactBook7QA
I think that in the picture 1.5 in the first is the main error. React does not wrap the letter o and the word world into additional span tags
I noticed that for the read-only Rating control (in the Whinepad app), the mouse pointer changes between an arrow (hovering over a highlighted star) to a vertical bar (hovering over a non-highlighted star). I was able to fix this by changing the cursor type from "auto" to "default" in the Rating.RatingReadonly style. This change allows the pointer to remain as an arrow no matter where it is in the control, at least using Chrome on Windows.
.Rating.RatingReadonly {
cursor: default;
}
Line 168 in Excel.js, variable "content" is declared a second time. Removing "var" from that line clears the warning.
in Button.js (page 111) PropTypes is not in React anymore, it's a separate import.
import PropTypes from 'prop-types';
also applies to Excel.js
use version 16 to build the code, but it failed in lesson ONE T_T, build 'Hello world' and then throw the error, HELP T_T
Hey Stoyan,
could you tell me please, how can I run examples from the folder whinepad v0.0.1.
It says http://prntscr.com/h3gt2z
Uncaught TypeError: Cannot read property 'arrayOf' of undefined
at Object.33.react (bundle.js:21004)
I guess it's in some way related to the new version of react but my knowledge is not enough yet to fix it by myself.
Or maybe could you advise how can I use old version using npm for examples of your book.
Thanks in advance!
While modifying the tests to learn about recent upgrades to Jest, expect getValue()
to be equal to the defaultValue
prop failed for <FormInput type="year" defaultValue={2015} />
from the schema sample because "2015" was the actual value. Hurray for tests.
However, not being sure what to do if the input is not a number and yet not distract from the main point, I will refrain from submitting a pull request ;)
Since a strange ternary expression does not save the first "newState" value, the first is not saved to __log variable.
The fix may be as follows:
, _logSetState: function(newState) {
if ( this._log.length === 0 ) { // log first state
let firstStateClone = this.state;
this._log.push(firstStateClone);
}
// always log newState
let stateClone = JSON.parse( JSON.stringify(newState) );
this._log.push(stateClone);
this.setState(newState);
}
warning in chrome: Warning: Expected onClick
listener to be a function, instead got a value of boolean
type. It still works though.
for this code in render():
onClick={!this.props.readonly && this.setRating.bind(this, i)}
onMouseOver={!this.props.readonly && this.setTemp.bind(this, i)}
Instead, if you do this, no warning:
onClick = { !this.props.readonly ? this.setRating.bind(this,i) : null}
onMouseOver= { !this.props.readonly ? this.setTemp.bind(this,i) : null}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.