diff --git a/.lintstagedrc.js b/.lintstagedrc.js
index 313a9067d..763d5bc9c 100644
--- a/.lintstagedrc.js
+++ b/.lintstagedrc.js
@@ -1,3 +1,3 @@
module.exports = {
- '**/*.{js,jsx,ts,tsx}': ['jest -c .jest.config.js --findRelatedTests', 'prettier --write'],
+ '**/*.{js,jsx,ts,tsx}': ['jest -c .jest.config.js --findRelatedTests --passWithNoTests', 'prettier --write'],
};
diff --git a/pages/docs.json b/pages/docs.json
index 37486a681..556bfe4c8 100644
--- a/pages/docs.json
+++ b/pages/docs.json
@@ -85,9 +85,6 @@
{
"title": "Supported CSS"
},
- {
- "title": "Flow"
- },
{
"title": "TypeScript"
},
@@ -127,6 +124,9 @@
"title": "FAQs",
"pathname": "faqs",
"sections": [
+ {
+ "title": "What do I need to do to migrate to v6?"
+ },
{
"title": "What do I need to do to migrate to v5?"
},
diff --git a/pages/docs/api.mdx b/pages/docs/api.mdx
index a9b90e7f7..1cdfd9f38 100644
--- a/pages/docs/api.mdx
+++ b/pages/docs/api.mdx
@@ -4,7 +4,6 @@ import NextPage from '../../components/NextPage'
import Primary from '../../sections/api/primary/index.mdx'
import Helpers from '../../sections/api/helpers/index.mdx'
import SupportedCSS from '../../sections/api/supported-css.mdx'
-import Flow from '../../sections/api/flow.mdx'
import TypeScript from '../../sections/api/typescript.mdx'
import OldAPIs from '../../sections/api/old/index.mdx'
import TestUtilities from '../../sections/api/test-utils/index.mdx'
@@ -19,7 +18,6 @@ export default ({ children }) => (
-
diff --git a/pages/docs/faqs.mdx b/pages/docs/faqs.mdx
index 24af24bad..ea17e1aaa 100644
--- a/pages/docs/faqs.mdx
+++ b/pages/docs/faqs.mdx
@@ -11,6 +11,7 @@ import HTMLAttributeWarnings from '../../sections/faqs/html-attribute-warnings.m
import BrowserSupport from '../../sections/faqs/browser-support.mdx'
import MigrationV4 from '../../sections/faqs/migration-v4.mdx'
import MigrationV5 from '../../sections/faqs/migration-v5.mdx'
+import MigrationV6 from '../../sections/faqs/migration-v6.mdx'
import CRA from '../../sections/faqs/create-react-app.mdx'
import NPMLink from '../../sections/faqs/npm-link.mdx'
import FlickeringText from '../../sections/faqs/flickering-text.mdx'
@@ -18,11 +19,12 @@ import DeclareComponentsInRenderMethod from '../../sections/faqs/declare-compone
import MissingNativeImport from '../../sections/faqs/missing-native-import.mdx'
export default ({ children }) => (
-
-{children}
-
+
+ {children}
+
)
+
diff --git a/pages/index.js b/pages/index.js
index fb96293a9..93d7d66f6 100644
--- a/pages/index.js
+++ b/pages/index.js
@@ -30,7 +30,7 @@ const SupportingTagline = styled.h2`
`;
const headerCode = `
-const Button = styled.a\`
+const Button = styled.a<{ $primary?: boolean; }>\`
/* This renders the buttons above... Edit me! */
display: inline-block;
border-radius: 3px;
diff --git a/sections/advanced/components-as-selectors.mdx b/sections/advanced/components-as-selectors.mdx
index 04641084f..7d2617114 100644
--- a/sections/advanced/components-as-selectors.mdx
+++ b/sections/advanced/components-as-selectors.mdx
@@ -63,7 +63,7 @@ This behaviour is only supported within the context of _Styled_ Components:
attempting to mount `B` in the following example will fail because component
`A` is an instance of React.Component not a Styled Component.
-```jsx
+```tsx
class A extends React.Component {
render() {
return
@@ -82,7 +82,7 @@ styled component is attempting to call the component as an interpolation functio
However, wrapping `A` in a styled() factory makes it eligible for interpolation -- just
make sure the wrapped component passes along `className`.
-```jsx
+```tsx
class A extends React.Component {
render() {
return
diff --git a/sections/advanced/existing-css.mdx b/sections/advanced/existing-css.mdx
index 91b590ad5..5b3fadfc2 100644
--- a/sections/advanced/existing-css.mdx
+++ b/sections/advanced/existing-css.mdx
@@ -13,7 +13,7 @@ If you use the `styled(MyComponent)` notation and `MyComponent` does not
render the passed-in `className` prop, then no styles will be applied.
To avoid this issue, make sure your component attaches the passed-in className to a DOM node:
-```jsx
+```tsx
class MyComponent extends React.Component {
render() {
// Attach the passed-in className to the DOM node
@@ -25,7 +25,7 @@ class MyComponent extends React.Component {
If you have pre-existing styles with a class, you can combine the global class with the
passed-in one:
-```jsx
+```tsx
class MyComponent extends React.Component {
render() {
// Attach the passed-in className to the DOM node
@@ -40,7 +40,7 @@ If you apply a global class together with a styled component class, the result m
what you're expecting. If a property is defined in both classes with the same specificity,
the last one will win.
-```jsx
+```tsx
// MyComponent.js
const MyComponent = styled.div`background-color: green;`;
@@ -84,7 +84,7 @@ body.my-body button {
Since the rule contains a classname and two tag names, it has higher specificity than the single
classname selector generated by this styled component:
-```jsx
+```tsx
styled.button`
padding: 16px;
`
diff --git a/sections/advanced/security.mdx b/sections/advanced/security.mdx
index b06f8db91..5124a73ab 100644
--- a/sections/advanced/security.mdx
+++ b/sections/advanced/security.mdx
@@ -7,7 +7,7 @@ browser that an attacker can place in your application.
This example shows how bad user input can even lead to API endpoints being called on a user's
behalf.
-```jsx
+```tsx
// Oh no! The user has given us a bad URL!
const userInput = '/api/withdraw-funds'
diff --git a/sections/advanced/server-side-rendering.mdx b/sections/advanced/server-side-rendering.mdx
index 4e691a32d..a049c1863 100644
--- a/sections/advanced/server-side-rendering.mdx
+++ b/sections/advanced/server-side-rendering.mdx
@@ -20,7 +20,7 @@ If possible, we definitely recommend using the babel plugin though because it is
The basic API goes as follows:
-```jsx
+```tsx
import { renderToString } from 'react-dom/server';
import { ServerStyleSheet } from 'styled-components';
@@ -40,7 +40,7 @@ The `collectStyles` method wraps your element in a provider. Optionally you can
the `StyleSheetManager` provider directly, instead of this method. Just make sure not to
use it on the client-side.
-```jsx
+```tsx
import { renderToString } from 'react-dom/server';
import { ServerStyleSheet, StyleSheetManager } from 'styled-components';
@@ -98,7 +98,7 @@ _On the server:_
`ReactDOMServer.renderToNodeStream` emits a "readable" stream that styled-components wraps. As whole chunks of HTML are pushed onto the stream, if any corresponding styles are ready to be rendered, a style block is prepended to React's HTML and forwarded on to the client browser.
-```js
+```tsx
import { renderToNodeStream } from 'react-dom/server';
import styled, { ServerStyleSheet } from 'styled-components';
@@ -124,7 +124,7 @@ stream.on('end', () => res.end('