This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module 'react-photoswipe' { | |
import * as React from 'react'; | |
export interface PhotoSwipeGalleryItem { | |
src: string; | |
thumbnail: string; | |
w: number; | |
h: number; | |
title: string; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface FooProps { | |
someProp: string; | |
someOtherProp: boolean; | |
} | |
const FooComponent: React.SFC<FooProps> = (props) => ( | |
<div>Hello!</div> | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Example extends React.PureComponent<any, any> { | |
render() { | |
return ( | |
<Query | |
query={getUsers} | |
> | |
{({ data, loading, error }) => { | |
// Do something with the user data | |
}} | |
</Query> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react'; | |
import * as renderer from 'react-test-renderer'; | |
import MyComponent from '../MyComponent'; | |
describe('<MyComponent />', () => { | |
it('should render without props', () => { | |
const json = renderer.create(<MyComponent />).toJSON(); | |
expect(json).toMatchSnapshot(); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"compilerOptions": { | |
"module": "commonjs", | |
"target": "esnext", | |
"jsx": "react", | |
"sourceMap": false, | |
"experimentalDecorators": true, | |
"noImplicitUseStrict": true, | |
"removeComments": false, | |
"moduleResolution": "node", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const enzyme = require('enzyme'); | |
const Adapter = require('enzyme-adapter-react-16'); | |
const config = require('./next.config'); | |
const nextConfig = require('next/config'); | |
enzyme.configure({ adapter: new Adapter() }); | |
nextConfig.setConfig({ | |
publicRuntimeConfig: { | |
IMAGE_SERVER_URL: 'http://images.foo.bar', | |
IMAGE_PROCESSOR_URL: 'https://processor.foo.bar', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
setupFiles: ['<rootDir>/jest.setup.js'], | |
testPathIgnorePatterns: ['<rootDir>/.next/', '<rootDir>/node_modules/'], | |
transform: { | |
"^.+\\.tsx?$": "ts-jest", | |
}, | |
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", | |
collectCoverageFrom: [ | |
"**/*.{js,jsx,ts,tsx}", | |
"!**/_app.tsx", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.foo { | |
padding: 1px 1.5px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Pathogen | |
execute pathogen#infect() | |
" Basics | |
syntax on | |
filetype plugin indent on | |
set number | |
let mapleader = "," | |
set guifont=Menlo\ Regular:h13 |
NewerOlder