1
            <Link
              to={{
                pathname: "/studentDetails",
                state: {
                  selectedStudent: studentsData,
                },
              }}
            >
              {basicData.studentName}
            </Link>
   

In the above code, it is the example for sending Objects with link in react.js using react-router-dom. And currently I'm developing a react native app and for that, I'm using react-router-native(https://reactrouter.com/native/guides/quick-start) as my router. And how to pass Objects with links using this NPM Package in react native

MANOJ H M
  • 57
  • 1
  • 1
  • 8

2 Answers2

0

can you show what this show you when you try to get the state cause as I know it should be the same

TalOrlanczyk
  • 786
  • 3
  • 14
0

Try this, im hoping basicData[] is your state array ,<Link to={{ pathname: "/studentDetails", state: { selectedStudent: basicData.studentsData, }, }} >

Aditya m
  • 1
  • 1