Skip to content

Instantly share code, notes, and snippets.

@tomraithel
Last active April 26, 2018 10:57
Show Gist options
  • Save tomraithel/ad8cced2ad416874b320adb7fa97a0e1 to your computer and use it in GitHub Desktop.
Save tomraithel/ad8cced2ad416874b320adb7fa97a0e1 to your computer and use it in GitHub Desktop.
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