-
Briefly explain the difference between props and states
-
What are synthetic events in React?
-
What are refs and give example of a use case?
-
What are portals in React?
-
What will the code below output to the console and why?
var myObject = {
foo: "bar",
func: function() {
var self = this;
console.log("outer func: this.foo = " + this.foo);
console.log("outer func: self.foo = " + self.foo);
(function() {
console.log("inner func: this.foo = " + this.foo);
console.log("inner func: self.foo = " + self.foo);
}());
}
};
myObject.func();
- Consider the two functions below. Will they both return the same thing? Why or why not?
function foo1()
{
return {
bar: "hello"
};
}
function foo2()
{
return
{
bar: "hello"
};
}
- Briefly with examples explain how you would share a component state to another.
Create a simple weather app in react-native app, it should display the weather of the current location and allow filtering to check other locations, other details details to be displayed should be the current date, city name and country and time. Feel free to use the openweathermap API, the interface should be intuitive and easy to use.