Skip to content

Instantly share code, notes, and snippets.

@sb-bilal-dev
Last active April 27, 2021 17:31
Show Gist options
  • Save sb-bilal-dev/0721a509877ef5611d11d2624fbf4cc0 to your computer and use it in GitHub Desktop.
Save sb-bilal-dev/0721a509877ef5611d11d2624fbf4cc0 to your computer and use it in GitHub Desktop.
// On renders
const renderFoo = (data) => (<div>{data.code}</div>)
// On some shit code
cosnt mapState = (state) => ({
userName: state.users && state.users.activeUser && state.users.activeUser.name,
customer: state.customer && state.customer.cars,
})
// Inside conditional expressions
if (currentCustomer && currentCustomer.balance < 200) {} else {}
// Some more
<span>{!isLoading && currentCustomer && currentCustomer.isVIP ? currentCustomer.balance : null}</span>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment