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

Button uppercase default not strictly checked #31

Open
ShaunSpringer opened this issue Jan 14, 2018 · 1 comment
Open

Button uppercase default not strictly checked #31

ShaunSpringer opened this issue Jan 14, 2018 · 1 comment

Comments

@ShaunSpringer
Copy link

ShaunSpringer commented Jan 14, 2018

Config:

  • RN 0.52.0
  • Nachos 0.1.2

Problem:
When not explicitly setting uppercase=false on some buttons, it throws an error (here)

Some basic example code:

import React, { Component } from 'react';
import { View } from 'react-native';
import { Button } from 'nachos-ui';
import Config from 'react-native-config';
import { inject, observer } from 'mobx-react';


@inject('UserStore')
@observer
export default class LoginContainer extends Component {

  _renderButton() {
    const { UserStore } = this.props;
    if (UserStore.isLoggedIn === true) {
      // Adding uppercase={ false } here fixes the error
      return (
        <Button onPress={ UserStore.login } >
          Continue As { UserStore.user.displayName }
        </Button>
      );
    }

    return (
      <Button onPress={ UserStore.login }>
        Login With Facebook
      </Button>
    );
  }

  render() {
    return (
      <View>
        { this._renderButton() }
      </View>
    );
  }
}

Proposed solution:

  • Use explicit checking (uppercase === true) on the line linked above
@mattapperson
Copy link
Member

Thanks for filing this issue! What is the exact error you are seeing? If you have a moment, could you perhaps provide an example thats a little easier for me to copy/paste to reproduce?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants