Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Renaming props in react

const UserCard = ({ name, role: occupation }) => {
  return (
    <div>
      <p>Name: {name}</p>
      <p>Occupation: {occupation}</p>
    </div>
  )
}

function App() {
  return (
    <div>
      <UserCard name="Adil" role="Frontend Developer" />
    </div>
  )
}

export default App
Comment

PREVIOUS NEXT
Code Example
Javascript :: Example code of using inner blocks in Wordpress with ES5 
Javascript :: Adding Custom Admin Notices in the Classic Editor wordpress 
Javascript :: Rest and spread operators in ES6 
Javascript :: Classes and constructor functions in ES6 
Javascript :: react get query params from url 
Javascript :: used as a function, Number() will convert another value 
Javascript :: react clearinterval outside of useefect 
Javascript :: import * as stringFunctions from "./string_functions.js"; // add code above this line stringFunctions.uppercaseString("hello"); stringFunctions.lowercaseString("WORLD!"); 
Javascript :: A Note about Floats 
Javascript :: expo google sign inredirect uri mismatch 
Javascript :: ReactComponent as DeleteIcon 
Javascript :: nodejs mongoose connec tion 
Javascript :: react break out of useeffect 
Javascript :: set state giving previously update data 
Javascript :: jshack1 
Javascript :: convert base64 to image javascript 
Javascript :: firebase ststokenmanager return undefined 
Javascript :: More generic sort on each condition js 
Javascript :: react Colored rating 
Javascript :: 5.3.2. Operator Precedence 
Javascript :: hide parent component when child component loaded 
Javascript :: js collection 
Javascript :: sum the two first minimum numbers in an array 
Javascript :: react native carriage return 
Javascript :: toast duplicate angular 
Javascript :: print array elements in new line javascript 
Javascript :: rebuild package-lock.json 
Javascript :: angular material slide effect button click 
Javascript :: sessionStorage on DOMContentLoaded javascript 
Javascript :: local storage textarea 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =