Open MWTuttle opened 1 year ago
What error are you getting? I have just opened a pr to update the examples, https://github.com/mohux/react-brackets/pull/26
The working first example would now be:
import { Bracket, IRoundProps } from 'react-brackets';
const rounds: IRoundProps[] = [
{
title: 'Round one',
seeds: [
{
id: 1,
date: new Date().toDateString(),
teams: [{ name: 'Team A' }, { name: 'Team B' }],
},
{
id: 2,
date: new Date().toDateString(),
teams: [{ name: 'Team C' }, { name: 'Team D' }],
},
],
},
{
title: 'Round one',
seeds: [
{
id: 3,
date: new Date().toDateString(),
teams: [{ name: 'Team A' }, { name: 'Team C' }],
},
],
},
];
const Component = () => {
return <Bracket rounds={rounds} />;
};
Here's what I have in NewBracket.tsx:
import { View, Text } from 'react-native';
import { Bracket, IRoundProps } from 'react-brackets';
const rounds: IRoundProps[] = [
{
title: 'Round one',
seeds: [
{
id: 1,
date: new Date().toDateString(),
teams: [{ name: 'Team A' }, { name: 'Team B' }],
},
{
id: 2,
date: new Date().toDateString(),
teams: [{ name: 'Team C' }, { name: 'Team D' }],
},
],
},
{
title: 'Round one',
seeds: [
{
id: 3,
date: new Date().toDateString(),
teams: [{ name: 'Team A' }, { name: 'Team C' }],
},
],
},
];
const NewBracket = () => {
return <Bracket rounds={rounds} />;
};
export default NewBracket;
and I get the following:
It looks like NewBracket returns undefined
Does it work if you do:
const NewBracket = () => {
return <Bracket rounds={rounds} />;
};
Sorry @Oliver-Looney , I'm not sure if I follow your suggestion. That const statement looks identical to what I have, unless you are suggesting I remove the export?
I replied before you edited your code example,
Ha, sorry for the mixup.
Hi @Oliver-Looney, I was wondering if you had any more insights you could share.
Hello and thank you for making such a nice looking library.
I am trying to get this working with React Native. I was hoping someone could give me some hints on how to get started. I tried getting the minimal first example working but it is breaking my build, and I don't have experience getting web libraries working on mobile.