pcui icon indicating copy to clipboard operation
pcui copied to clipboard

An example of how to use framework with ReactJS

Open HusakYurii opened this issue 3 years ago • 2 comments

I was amazed by the framework when I found out about it! However, when I tried to use the framework as npm dependency in my react project I couldn't make it work. I set up a generic react project by running scripts the ReactJS library provides out of the box and added the PCUI as an npm dependency.. Then I followed the instructions describing how to use the framework components as the react components. But import Label from 'dist/Label/component'; led to a warning Cannot find module 'dist/Label/component' or its corresponding type declarations.

I would like PCUI to have some doc about how to use the framework with ReactJS or a boilerplate for React + PCUI projects a dev can start off. I can assist with writing that doc or boilerplate if you are short of hands 😉

HusakYurii avatar Oct 25 '21 19:10 HusakYurii

Hi @HusakYurii

There is a guide in our docs for React + PCUI: https://playcanvas.github.io/pcui/react/ And you can see a more extensive example here: https://playcanvas.github.io/pcui/examples/todo/

It'd be great if you could offer any other suggestions on how we may need to expand the React documentation.

ellthompson avatar Jun 10 '22 10:06 ellthompson

Hey @ellthompson ! Thanks for getting back to my question. I tried to use the PCUI as the examples in the doc show, but the import statements showed errors. I already forgot how I tried to use it, but I tried multiple ways 🤔 Has the documentation been updated since 25 Oct 2021

HusakYurii avatar Jun 11 '22 18:06 HusakYurii

Hi @HusakYurii. This issue has gone a little bit stale. PCUI has updated significantly in the last couple of weeks and just hit v3.0.0. I would suggest trying again. If there are still problems, we will investigate.

willeastcott avatar Dec 23 '22 16:12 willeastcott

Closing as I suspect this is no longer an issue. But feel free to reopen if you are continuing to experience problems.

willeastcott avatar Jan 09 '23 15:01 willeastcott