React Typescript Boilerplate v.0.7

Hi, I was looking for a react with typescript boilerplate and this one seems to be a bit out of date: GitHub - FloorLamp/dfinity-react-ts-tailwind-starter: Create DFINITY React App

So thanks to @cryptoschindler using this example dfinity-streams/index.js at 34be2c0fee7d1125f8b54fc55223af2eede29075 · SuddenlyHazel/dfinity-streams · GitHub

I’ve managed to get it to work. You can see it here: GitHub - gabrielnic/dfinity-react

It’s pretty barebone but I will add more things on the way.

5 Likes

Hello, @Gabriel I have one question about the agent and identities-PrinicpalIDs. Does the agent create new Principals per browser like we already know? I am new to agent so I am currently trying to understand how it works and what could I create with that.

Thank you!

That particular setup will store an identity in the browser’s local storage, it’ll keep using this one if found. If you were to delete your browser’s local data it would generate you a new one. See this part: dfinity-react/agent.js at main · gabrielnic/dfinity-react · GitHub

2 Likes

I’ve update the project to use dfinity agent 0.7.1 and dfx version 0.7.0-beta.2

I’ve created 3 issues so any help is appreciated.

@kpeacock I know you (and your team) are taking care of the dfinity agent so any suggestions/help is welcomed.

Thanks

3 Likes

Thanks for creating the issues! We do generate a d.ts file alongside the other content in dfx-generated, but I recognize the ergonomics aren’t great. I’ve got a proposal on the backlog to provide a command to generate those files so they can be committed into your source code.

you need to import _SERVICE and pass it to Actor.createActor<_SERVICE>(...

Long term goal is for this to all be automatic, but I do want to get you unblocked.

I think the BigInt issue will go away when we release the next version of DFX that removes the BigNumber references, and idk what’s up with the SVG

1 Like