Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated dependencies to the latest stable versions #9

Merged
merged 28 commits into from
Nov 17, 2017
Merged

Conversation

iPhaeton
Copy link
Contributor

No description provided.

@iPhaeton
Copy link
Contributor Author

iPhaeton commented Oct 30, 2017

See issue #5

@shaleynikov
Copy link
Contributor

It also resolves #8

@shaleynikov
Copy link
Contributor

As far as I can see it also resolves #1

@@ -1,6 +1,6 @@
import * as React from 'react';
import Link from 'next/link';
import styled from 'styled-components';
const styled = require('styled-components').default;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure const styled = require('styled-components').default is a good approach. Why exactly import styled from 'styled-components' doesn't work?

Copy link
Contributor Author

@iPhaeton iPhaeton Oct 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it has to do with this issue
styled-components/babel-plugin-styled-components#41 (comment)
When we use import styled from 'styled-components', it gets transformed to styled_components_1.default by typescript compiler which is not recognized as a styled component helper by babel-plugin-styled-components.
I believe, this issue was present before, but wasn't obvious, because react 15 just replaced the mismatched server-generated markup.
Since react 16 doesn't do this anymore, it becomes evident in development mode. When a page gets loaded, the styles don't apply to the components because of className mismatch.

@@ -1,7 +1,7 @@
import * as React from 'react';
import { Header } from '../Header';
import { Footer } from '../Footer';
import styled from 'styled-components';
const styled = require('styled-components').default;

const Layout: React.StatelessComponent<any> = ({ children }): JSX.Element => (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have it properly typed avoiding <any> ?

@shaleynikov shaleynikov merged commit d2f879f into master Nov 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants