File tree 3 files changed +10
-5
lines changed
3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 1
1
import React , { Component , PropTypes } from 'react'
2
2
import { AppContainer } from 'react-hot-loader'
3
+ import { warn } from './utils'
3
4
4
5
export default class App extends Component {
5
6
static childContextTypes = {
@@ -67,15 +68,15 @@ function propsToState (props) {
67
68
back : ( ) => router . back ( ) ,
68
69
push : ( url , as ) => router . push ( url , as ) ,
69
70
pushTo : ( href , as ) => {
70
- console . warn ( `Warning: 'url.pushTo()' is deprecated. Please use 'url.push()' instead.` )
71
+ warn ( `Warning: 'url.pushTo()' is deprecated. Please use 'url.push()' instead.` )
71
72
const pushRoute = as ? href : null
72
73
const pushUrl = as || href
73
74
74
75
return router . push ( pushRoute , pushUrl )
75
76
} ,
76
77
replace : ( url , as ) => router . replace ( url , as ) ,
77
78
replaceTo : ( href , as ) => {
78
- console . warn ( `Warning: 'url.replaceTo()' is deprecated. Please use 'url.replace()' instead.` )
79
+ warn ( `Warning: 'url.replaceTo()' is deprecated. Please use 'url.replace()' instead.` )
79
80
const replaceRoute = as ? href : null
80
81
const replaceUrl = as || href
81
82
Original file line number Diff line number Diff line change
1
+ import { warn } from './utils'
1
2
const css = require ( 'glamor' )
2
3
3
- if ( process . env . NODE_ENV !== 'production' ) {
4
- console . error ( 'Warning: \'next/css\' is deprecated. Please use styled-jsx syntax instead.' )
5
- }
4
+ warn ( 'Warning: \'next/css\' is deprecated. Please use styled-jsx syntax instead.' )
6
5
7
6
/**
8
7
* Expose style as default and the whole object as properties
Original file line number Diff line number Diff line change
1
+ export function warn ( message ) {
2
+ if ( process . env . NODE_ENV !== 'production' ) {
3
+ console . error ( message )
4
+ }
5
+ }
You can’t perform that action at this time.
0 commit comments