Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Static function - when called returns whatever is after =>
- const Lambda = () => <h1>return goes here </h1>;
- // Process function - does something anad returns whatever is after return
- const LambdaWithProcess = () => {
- const sth = 'sthelse';
- return <h1>return goes here </h1>;
- };
- // Static with ONE prop - returns whatever you feed it (eg LambdaWithProp(sth) returns <h1>sth</h1>)
- const LambdaWithProp = prop => (
- <h1>{prop}</h1>
- );
- // Static with 1+ prop - returns whatever PROPS you feed it, if you give it one prop, errors out
- const LambdaWithPropS = (prop, index) => (
- <h1>
- {index}
- {prop}
- </h1>
- );
- // Static with processing - returns whatever you feed it and it processes it.
- const LambdaWithPropsAndProcessing = (prop1, prop2) => {
- const something = prop1 - prop2;
- return (
- <h1>{something}<h1>
- )
- }
Advertisement
Add Comment
Please, Sign In to add comment