Skip to content

Instantly share code, notes, and snippets.

😝
Changing the world through JavaScript (and TypeScript)!

Rodo Abad rodoabad

😝
Changing the world through JavaScript (and TypeScript)!
Block or report user

Report or block rodoabad

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
View ConsumingComponent.jsx
import * as React from 'react';
import {MyComponent} from './MyComponent';
import {consumingComponent} from './ConsumingComponent.scss';
const ConsumingComponent = () => (
<MyComponent
HeaderProps={{
color: 'red'
data-testid='consuming-component-header'
type: 'compact'
View MyComponent.jsx
import * as React from 'react';
import {Greeting, greetingProps} from './Greeting';
import {Header, headerProps} from './Header';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import {myComponent} from './MyComponent.scss';
export const MyComponent = (props) => {
const {
HeaderProps,
View MyComponent.jsx
import * as React from 'react';
import {Greeting} from './Greeting';
import {Header} from './Header';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import {myComponent} from './MyComponent.scss';
export const MyComponent = (props) => {
const {
className,
View MyComponent.jsx
import * as React from 'react';
import {Greeting} from './Greeting';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import {myComponent} from './MyComponent.scss';
export const MyComponent = ({className, color, greeting, ...otherProps}) => (
<section
{...otherProps}
className={classnames(className, myComponent)}
View MyComponent.jsx
import * as React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import {myComponent} from './MyComponent.scss';
export const MyComponent = ({className, greeting, ...otherProps}) => (
<section
{...otherProps}
className={classnames(className, myComponent)}
>
View MyComponent.jsx
import * as React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import {myComponent} from './MyComponent.scss';
export const MyComponent = ({className, greeting}) => (
<section className={classnames(className, myComponent)}>
{greeting}
</section>
);
View MyComponent.jsx
import * as React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import {myComponent} from './MyComponent.scss';
export const MyComponent = (props) => (
<section className={classnames(props.className, myComponent)}>
Hello world.
</section>
);
View MyComponent.jsx
import * as React from 'react';
import {myComponent} from './MyComponent.scss';
export const MyComponent = () => (
<section className={myComponent}>
Hello world.
</section>
);
View user-dashboard-2.js
import React from 'react';
import {UserGreetingConnector as UserGreeting} from './user-greeting-connector';
export const UserDashboard = () => (
<UserGreeting/>
);
View user-greeting-connector-2.js
import {UserGreeting} from './user-greeting';
import {connect} from 'react-redux';
const mapStateToProps = ({user}) => ({
firstName: user.firstName,
lastName: user.lastName
});
export const UserGreeetingConnector = connect(mapStateToProps)(UserGreeting);
You can’t perform that action at this time.