Piroro-hs / react-native-twitter

A Twitter API client library for React Native. Currently not maintained as my main motivation of creating this library was to use the User Streams API.
MIT License
39 stars 20 forks source link

Sources for assign MUST be an object #13

Closed KeanuTomatoMomotaro closed 6 years ago

KeanuTomatoMomotaro commented 6 years ago

I'm getting a problem after attempting to invoke the rest.post() method to tweet some text.

The code for the method is postTweet(){ var tokens= { consumer_key: 'xxx', consumer_secret: 'xxx', access_token: 'xxx', access_token_secret: 'xxx', }; const {rest} = twitter(tokens); var path = 'statuses/update'; var params = this.state.text; rest.post(path , params) .then(() => {console.log('Posted');}) .catch(console.error); }

image

Piroro-hs commented 6 years ago

params should be an Object. Try rest.post('statuses/update', {status: this.state.text}). See Twitter docs for more info.