Skip to content

Instantly share code, notes, and snippets.


Awni Gharbia awnigharbia

Block or report user

Report or block awnigharbia

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
markerikson / render-logic.js
Last active Jan 6, 2020
React render function organization
View render-logic.js
class ParentComponent extends Component {
render() {
// My basic render function structure:
// 1) Extract values from props and state
const {a, b, someBoolean, someList} = this.props;
// 2) Render any dependent items into temporary variables, such as conditional components or lists
const conditionalComponent = someBoolean ? <SomeComponent /> : null;
const listItems = => <ListItem item={item} />);
krambertech / Component.jsx
Created Jul 2, 2016
ReactJS: Input fire onChange when user stopped typing (or pressed Enter key)
View Component.jsx
import React, { Component } from 'react';
import TextField from 'components/base/TextField';
const WAIT_INTERVAL = 1000;
const ENTER_KEY = 13;
export default class TextSearch extends Component {
constructor(props) {
You can’t perform that action at this time.