CSCI 4300 FINAL EXAM WITH 100% CORRECT ANSWERS
React was created by ______________ . - ANSWER Facebook developers
React's process for determining which updates need to be made to the UI to reflect
changes in the component state: - ANSWER Reconciliation
Converts HTML tags into React elements, allowing us to write HTML elements in
JavaScript and place them in the DOM without the createElement() method. - ANSWER
JSX
What are props in React? - ANSWER Data you pass from a parent component to a child
component.
What are components in React? - ANSWER Core UI building blocks - special
JavaScript functions that return JSX.
What is true about declaring my shopping cart this way in React?
function ShoppingCart() { const [cart, setCart] = useState([]); - ANSWER refresh of the
page is not necessary to update my cart
Any changes to 'cart' using 'setCart' will trigger a re-render of the 'ShoppingCart'
component.
The approach used in React where the developer describes the target UI state(s) and
lets React figure out how to get there. The developer can skip the overhead of selecting
DOM elements and changing them manually. - ANSWER Declarative
What is the process to share state between components when props can only be passed
down? - ANSWER lifting state up
, React function components return ________________ . - ANSWER a React element (JSX)
The name of the special prop in React used to pass the data enclosed within the parent's
opening and closing tag. - ANSWER Children
React rerenders on - ANSWER state change
Which of the following describe useState() - ANSWER a React hook
a built-in feature of React
enables you to manage data, which, when updated, tells React to update the UI
accordingly.
returns an array of 2 elements
To implement proper updating of state that is based on previous state: - ANSWER pass
a function to the updating function that accepts at least one parameter to the updating
function
What does this react code accomplish?
import Role from "./Role"
function App(){
return (
<div className = "App">
<Role name="Tim" role = "tool guy" />
</div>
)
}
export default App - ANSWER Creates a component that passes props name and role
to the Role component
React was created by ______________ . - ANSWER Facebook developers
React's process for determining which updates need to be made to the UI to reflect
changes in the component state: - ANSWER Reconciliation
Converts HTML tags into React elements, allowing us to write HTML elements in
JavaScript and place them in the DOM without the createElement() method. - ANSWER
JSX
What are props in React? - ANSWER Data you pass from a parent component to a child
component.
What are components in React? - ANSWER Core UI building blocks - special
JavaScript functions that return JSX.
What is true about declaring my shopping cart this way in React?
function ShoppingCart() { const [cart, setCart] = useState([]); - ANSWER refresh of the
page is not necessary to update my cart
Any changes to 'cart' using 'setCart' will trigger a re-render of the 'ShoppingCart'
component.
The approach used in React where the developer describes the target UI state(s) and
lets React figure out how to get there. The developer can skip the overhead of selecting
DOM elements and changing them manually. - ANSWER Declarative
What is the process to share state between components when props can only be passed
down? - ANSWER lifting state up
, React function components return ________________ . - ANSWER a React element (JSX)
The name of the special prop in React used to pass the data enclosed within the parent's
opening and closing tag. - ANSWER Children
React rerenders on - ANSWER state change
Which of the following describe useState() - ANSWER a React hook
a built-in feature of React
enables you to manage data, which, when updated, tells React to update the UI
accordingly.
returns an array of 2 elements
To implement proper updating of state that is based on previous state: - ANSWER pass
a function to the updating function that accepts at least one parameter to the updating
function
What does this react code accomplish?
import Role from "./Role"
function App(){
return (
<div className = "App">
<Role name="Tim" role = "tool guy" />
</div>
)
}
export default App - ANSWER Creates a component that passes props name and role
to the Role component