jasonleibowitz / react-add-to-calendar-hoc

Simple Unopinionated React Add to Calendar Button. Bring your own components.
http://leibowitz.me/react-add-to-calendar-hoc/docs/
MIT License
70 stars 40 forks source link

invariant voilation: the title prop of a button must be a string #18

Closed muhammadhaseebsohail closed 5 years ago

muhammadhaseebsohail commented 5 years ago

Bug report

simulator screen shot - iphone x - 2019-01-08 at 11 09 24

My code is : import AddToCalendarHOC from 'react-add-to-calendar-hoc'; const AddToCalendarDropdown = AddToCalendarHOC(Button, Dropdown); import moment from 'moment/min/moment-with-locales'

const startDatetime = moment().utc().add(2, 'days'); const endDatetime = startDatetime.clone().add(2, 'hours'); const duration = endDatetime.diff(startDatetime, 'hours'); const event = { description: 'Description of event. Going to have a lot of fun doing things that we scheduled ahead of time.', duration, endDatetime: endDatetime.format('YYYYMMDDTHHmmssZ'), location: 'NYC', startDatetime: startDatetime.format('YYYYMMDDTHHmmssZ'), title: 'Super Fun Event', }

render() { return (

Calender event start calender event end
);

}

Can you please help me out , how can i figure out this?

jasonleibowitz commented 5 years ago

Do you have a repo you can link to where this error is happening? It’s kind of hard to figure out what’s going on from the text you posted.

muhammadhaseebsohail commented 5 years ago

this is what i am doing @jasonleibowitz : import { Button, Dropdown, } from "react-native";

import AddToCalendarHOC from 'react-add-to-calendar-hoc'; const AddToCalendarDropdown = AddToCalendarHOC(Button, Dropdown); const startDatetime = moment().utc().add(2, 'days'); const endDatetime = startDatetime.clone().add(2, 'hours'); const duration = endDatetime.diff(startDatetime, 'hours'); const event = { description: 'Description of event. Going to have a lot of fun doing things that we scheduled ahead of time.', duration, endDatetime: endDatetime.format('YYYYMMDDTHHmmssZ'), location: 'NYC', startDatetime: startDatetime.format('YYYYMMDDTHHmmssZ'), title: 'Super Fun Event', }

export default class App extends Component{

render() { return ( <AddToCalendarDropdown className={componentStyles} linkProps={{ className: linkStyles, }} event={event} />

);

} }

jasonleibowitz commented 5 years ago

Well there’s your issue - this library wasn’t built for React Native. Feel free to fork it, make any changes, and submit a PR if you want to add support for React Native.

P.S. Check out this link on how to enter code blocks in Github markdown. It makes reading your code significantly easier.

muhammadhaseebsohail commented 5 years ago

can you please recommend me a library for this? i need to copy sessions to gmail/outlook? i will be greatfull to you.

jasonleibowitz commented 5 years ago

Try googling react native add to calendar?

muhammadhaseebsohail commented 5 years ago

acknowledge