Giter Site home page Giter Site logo

Comments (7)

mitchellbutler avatar mitchellbutler commented on May 7, 2024 3

The @ symbol is called a decorator (check out this article for reference). Your environment may not implement them, especially since they're still part of a proposal that's subject to change. For now you can ignore the decorator shorthand like this:

import React, { Component } from 'react';
import { connectActionSheet } from '@expo/react-native-action-sheet';

class TheClassYouWantToConnect extends Component {
  // ...
}

export default connectActionSheet(TheClassYouWantToConnect);

from react-native-action-sheet.

mfxuus avatar mfxuus commented on May 7, 2024 1

I've wrapped the <ActionSheetProvider> in the top-level component but still no luck... same SyntaxError. Not sure what I'm doing wrong.

from react-native-action-sheet.

TaoHenry avatar TaoHenry commented on May 7, 2024

access actionSheet method as this.props.showActionSheetWithOptions and I received this err: 'undefined is not a function (near '...this.props.showActionSheetWithOptions...')"

from react-native-action-sheet.

2207345508 avatar 2207345508 commented on May 7, 2024

I have this problem too.

from react-native-action-sheet.

adrianByv avatar adrianByv commented on May 7, 2024

Hi. I was wrapping my current component/screen with <ActionSheetProvider /> and getting the same error.

Like is said in README It must be wrapped to the top-level component.

I changed it to my top-level component and it worked.
App.js:

export default class App extends React.Component {
  render() {
    return (
      <ActionSheetProvider>
        <TabBar />
      </ActionSheetProvider>
    )
  }
}

from react-native-action-sheet.

peterpme avatar peterpme commented on May 7, 2024

Thanks @mitchellbutler. Closing this

from react-native-action-sheet.

tapir avatar tapir commented on May 7, 2024

Shouldn't be closed or at least should be in the documentations. Literally every new react installation gets the same error about decorators.

from react-native-action-sheet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.