From 4a34ee2200ade74e4f3429a199cb094df8f3d830 Mon Sep 17 00:00:00 2001 From: Tim Brandin Date: Fri, 6 Jan 2017 12:49:09 +0100 Subject: [PATCH] Added documentation. --- imports/ui/components/FormMessage.jsx | 1 + imports/ui/components/LoginForm.jsx | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/imports/ui/components/FormMessage.jsx b/imports/ui/components/FormMessage.jsx index 1278ba0..e611779 100644 --- a/imports/ui/components/FormMessage.jsx +++ b/imports/ui/components/FormMessage.jsx @@ -4,6 +4,7 @@ import { Accounts } from 'meteor/accounts-base'; export class FormMessage extends React.Component { render () { let { message, type, className = "message", style = {}, deprecated } = this.props; + // XXX Check for deprecations. if (deprecated) { // Found backwords compatibility issue. console.warn('You are overriding Accounts.ui.Form and using FormMessage, the use of FormMessage in Form has been depreacted in v1.3.0, update your implementation to use FormMessages: https://github.com/studiointeract/accounts-ui/#deprecations'); diff --git a/imports/ui/components/LoginForm.jsx b/imports/ui/components/LoginForm.jsx index f96c302..447c7fa 100644 --- a/imports/ui/components/LoginForm.jsx +++ b/imports/ui/components/LoginForm.jsx @@ -904,14 +904,14 @@ export class LoginForm extends Tracker.Component { this.setState({ messages: [] }); } - componentWillMount() { - // Check for backwards compatibility. - this.props.message = 'test'; + componentDidMount() { + // XXX Check for backwards compatibility. const container = document.createElement('div'); ReactDOM.render(, container); if (container.getElementsByClassName('message').length == 0) { // Found backwards compatibility issue with 1.3.x - console.warn('Implementations of Accounts.ui.Field must render message in v1.3.0 https://github.com/studiointeract/accounts-ui/#deprecations'); + console.warn(`Implementations of Accounts.ui.Field must render message in v1.3.0. + https://github.com/studiointeract/accounts-ui/#deprecations`); } } @@ -923,7 +923,7 @@ export class LoginForm extends Tracker.Component { render() { this.oauthButtons(); - // Backwords compatibility with v1.3.x. + // Backwords compatibility with v1.2.x. const { messages = [] } = this.state; const message = { deprecated: true,