tttstudios / react-native-otp-input

Tiny Javascript library which provides an elegant UI for user to input one time passcode.
MIT License
539 stars 242 forks source link

Syntax Error in styles.js -> 'styles' is not defined #53

Closed joeyfigaro closed 4 years ago

joeyfigaro commented 4 years ago

Describe the bug styles.js is exporting something that hasn't been defined

To Reproduce Steps to reproduce the behavior:

  1. Import component from library
  2. Start application/load component that's importing the OTPInput

Expected behavior N/A

Screenshots

Smartphone (please complete the following information):

Additional context Using Expo 36.0.0 with some babel overrides:

/* eslint-disable @typescript-eslint/no-var-requires */
module.exports = function(api) {
  api.cache(true)
  return {
    presets: ['babel-preset-expo'],
    plugins: [
      ['babel-plugin-graphql-tag', { importName: 'graphql-tag-ts' }],
      '@babel/plugin-transform-modules-commonjs',
      [
        'babel-plugin-styled-components',
        {
          displayName: true
        }
      ]
    ],
    env: {
      production: {
        plugins: ['react-native-paper/babel']
      }
    }
  }
}
baronha commented 4 years ago

I edit in node_modules @twotalltotems/react-native-otp-input/styles.js. I relace 'export default StyleSheet.create' instead of export default styles = StyleSheet.create. This is a basic error

joeyfigaro commented 4 years ago

PR up

joeyfigaro commented 4 years ago

It seemed like this project wasn't being maintained when I forked* it, so I added an .editorconfig—I can remove if you guys would prefer. :)

BeckyWu220 commented 4 years ago

Hi @joeyfigaro Thanks for contributing to the library. I would agree with removing the .editorconfig file. If you could make the change, we will merge it right away. Thanks!

BeckyWu220 commented 4 years ago

Fixed in PR https://github.com/tttstudios/react-native-otp-input/pull/48