From 2ed55a490007cebe58da483de967fe50af7a3bc6 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 1 Apr 2016 14:29:11 +0800 Subject: [PATCH] move deperated warning into componentDidMount --- components/queue-anim/index.jsx | 4 +++- components/validation/index.jsx | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/components/queue-anim/index.jsx b/components/queue-anim/index.jsx index cff6e95d3c..2daf5cbb65 100644 --- a/components/queue-anim/index.jsx +++ b/components/queue-anim/index.jsx @@ -3,10 +3,12 @@ import RcQueueAnim from 'rc-queue-anim'; import warning from 'warning'; export default class QueueAnim extends React.Component { - render() { + componentDidMount() { warning(false, '`QueueAnim` is deperated, ' + 'you can import QueueAnim from \'rc-queue-anim\' directly.' + 'The Demo will be moved to http://motion.ant.design/#/component/queue-anim'); + } + render() { return ; } } diff --git a/components/validation/index.jsx b/components/validation/index.jsx index aa5e79dfb1..21c8514e43 100644 --- a/components/validation/index.jsx +++ b/components/validation/index.jsx @@ -2,9 +2,11 @@ import React from 'react'; import warning from 'warning'; export default class Validation extends React.Component { - render() { + componentDidMount() { warning(false, '`Validation` is removed, please use `Form` which has supported validation after antd@0.12.0,' + - ' or you can just import Validation from \'rc-form-validation\' for compatibility'); + ' or you can just import Validation from \'rc-form-validation\' for compatibility'); + } + render() { return null; } }