Skip to content

Instantly share code, notes, and snippets.

View behnood-eghbali's full-sized avatar
🎯
Focusing

Behnood Eghbali behnood-eghbali

🎯
Focusing
View GitHub Profile
@behnood-eghbali
behnood-eghbali / App.tsx
Last active March 31, 2021 15:20
React + TypeScript code samples with error/bug fixes
import React, {Component} from 'react';
// import { createBrowserHistory } from 'history';
import Chats from './Chats';
import Contacts from './Contacts';
import 'bootstrap/dist/css/bootstrap.min.css';
import './App.css';
/* Error: Property 'path' is missing in type '{}' but required in type 'Readonly<Props>'. TS2741
Error: Type 'Props' is not assignable to type 'string'.ts(2322)
@behnood-eghbali
behnood-eghbali / Icon.js
Created August 12, 2018 08:19
Creating an SVG Icon System with React
import React, { Component } from 'react';
import PropTypes from 'prop-types';
class StarIcon extends Component {
render() {
const {color, width, height} = this.props;
return (
<svg className="star" width={width} height={height} fill={color} viewBox="0 0 200 200">
<path d="M100,10 L150,140 20,50 180,50 50,140 Z" />
</svg>