http://jasonwatmore.com/post/2017/03/14/react-pagination-example-with-logic-like-google
https://github.com/Silence11/reactPagination/blob/master/src/components/pagination.jsx
Candidate 1:
what's smart component and dumb component
what's redux flow
what are the middleware you using for redux
what have you been using for css preprocessor
unit test for React
where do you keep your biz logic? why
life cycle for react
what the most challenge question you handled in your dev work?
the f2f interview will be consist from 3 parts:
js code based on given wireframe(redline)
unit test
css
Candidate 2:
Which feature can we use to cause a component to render only when its ID changes?
How might React handle or restrict Props to certain types, or require certain Props to exist?
3. Compare and contrast setState() and forceUpdate(). What is the significance of each, and when would you use one or the other?
forceUpdate will bypass SCU, so when your render have some data that does not depend on the state or the props, you can use forceUpdate to update the view, for example, in our view your are replying on a random number, and this number is coming from Math.random, which does not saved on the sate or props, so in this scenario, you can use forceUpdate to re-render.
How might you use any data layer with React? What are the systemic requirements of doing so?
How would you create Higher Order Components (HOCs) in React?
a function takes a component as params, and inside the function you create a new component that wrap the component you passed in, and return this new component. So you can do a lot of fancy sork on this new component, you can require some data and pass the data to your component, you can reuse some logic to the
we use HOC to make our code dry, do not repeat yourself, to wrap some reusable code,
6. Difference between ES5 and ES6 pertaining to React? Advantages of each?
- require ---> import
React.createClass() ---> ES6 class
getInitialState ---> this.state in constructor
eventHandler //'this' auto bind in ES5 because we define it in createClass,
You need to define the static method inside the createClass, in ES6 you can define it our side class, such as Class.propTypes, Class.childContextTypes
advantage ES5: you have better control of your code, since ES6 will be transpiled to ES5 anyway
advantage ES6: better code format
- own module system 'import' , you do not need other library to do it
- class, writing class with extend is more clear than using createClass in ES5
- U do not need to update ur code once all the browoser support ES6 in the future
React Life Cycle?
Async Calls in React?
axios, thunk, saga
Candidate 3:
1) Lambda functions (arrow) - this
2) es6 vs es5 features
3) project work flow
4) pure functions - setState - immutable
5) smart vs dumb component
6) redux flow
6) flow of execution(heap, queue, stack flow)
7) closures
8) webpack
9) middleware (saga) - async