Skip to content

Instantly share code, notes, and snippets.

@tomraithel
Last active Apr 26, 2018
Embed
What would you like to do?
Vorschlag: Component Folder Pattern CoP Frontend

Vorschlag für Componenten-Struktur

Stand: Aktuell

radio
├── Radio.jsx
├── Radio.scss
├── RadioSpec.jsx
├── __mocks__
│   └── radio.js
└── __snapshots__
    └── RadioSpec.jsx.snap

Datei Radio.jsx

import React from 'react';
import PropTypes from 'prop-types';

import './Radio.scss';


export default class Radio extends React.Component {
  ...
}

Imports

import Radio from '../atoms/radio/Radio';

Vorschlag: NEU

Radio
├── README.md
├── __tests__
│   ├── __mocks__
│   │   └── testCaseXY.js
│   ├── __snapshots__
│   │   └── index.test.jsx.snap
│   └── index.test.jsx
├── index.jsx
└── index.scss

Datei AgencyCard.jsx

import React from 'react';
import PropTypes from 'prop-types';

import './index.scss';


export default class Radio extends React.Component {
  ...
}

Imports

import Radio from '../atoms/Radio';

Referenzen:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment