Open Dujota opened 1 year ago
Your reproduction link gives me the following message Unable to access this workspace It is likely that you are not a member of the team that this project belongs to. To be able to access the web editor of this repository and edit the code, you need to be invited to the team.
@cutterbl my apologies, I have changed permissions, you can now view the sandbox.
@Dujota still getting the same message
@cutterbl for some reason codesandbox is not allowing me to share this, the repo imported is public, the sandbox is public, so im not sure what the deal is.
I have a repository that re-creates this issue, you can fork it and then bring it into your sandbox? maybe that can also work?
https://github.com/Dujota/react-big-calendar-demo
all you need is the env vars which are
.env file:
NEXTAUTH_URL="http://localhost:3000"
DISCORD_CLIENT_ID=""
DISCORD_CLIENT_SECRET=""
let me know if that works for you, in the meantime i sent a support ticket to codesandbox for their bug
I looked through your code and saw the following
onView={() =>
console.log("on view triggered, but its not changing views")
}
A quick review of the view and onView documentation points out the issue here. The view
can be either controlled or uncontrolled. By utilizing onView
, you're telling Big Calendar that you will control the value of view
.
Turns out this is an issue, though unsure why. Something in the app is clashing with the used version of uncontrollable
. We can not, currently, update the dependency, as the HOC has been removed. For those running into the same issue, you can control the view
(with onView
), date
(with onNavigate
) and selected
(with onSelectEvent
) to get around the issue.
Same here. Using this in the meantime. https://jquense.github.io/react-big-calendar/examples/index.html?path=/docs/props--on-view
++ I just installed the package and have this same issue
edit: In my case it was just a misunderstanding of the lib. I thought <Calendar/>
would by default toggle the views. It turns out we gotta wire that behaviour ourselves. See the docs on onNavigate and onView
This bug happens when React Strict Mode is enabled because of this code https://github.com/jquense/uncontrollable/blob/v7.2.0/src/uncontrollable.js#L82-L84 in combination with https://github.com/jquense/uncontrollable/blob/v7.2.0/src/uncontrollable.js#L39.
Check that this is really a bug
Reproduction link
https://codesandbox.io/p/github/Dujota/react-big-calendar-demo/demo-rbc?workspaceId=ce7615f6-1791-4730-b586-fee7cce16a0d
Bug description
I can get events to show up and month is the default view, but any of the action buttons on the top (next/back day/week/month/agenda) do not work. they silently fail.
Expected Behavior
you should be able to switch views and be able to navigate through calendar days/months/weeks
Actual Behavior
you get to landing view (default view chosen) and none of the action buttons work.
you can see events etc, but you cant navigate, there is no output in console. no warnings or errors.
onView={() => console.log("onView trigered, but its not doing anything. ")}. is being triggered as it console logs the
react-big-calendar version
"^1.8.1"
React version
18.2.0
Platform/Target and Browser Versions
macOS, Windows, Chrome, IOS
Validations
Would you like to open a PR for this bug?