Component not loading in rails app
akhilgkrishnan opened this issue · 5 comments
Steps to reproduce
- git clone https://github.com/akhilgkrishnan/Rails-React-Boilerplate
- Install the dependencies
- Run both the rails server and Shakapacker
Expected behavior
App component should be rendered properly in root page.
Actual behavior
No result
System configuration
- Shakapacker or Sprockets version: shakapacker - 7.0.2
- React-Rails version: 2.6.2
- Rect_UJS version: 2.7.1
- Rails version: 7.0.6
- Ruby version: 3.2
React components are not loading in the app. There is no error showing in the Shakapacker compilation
@akhilgkrishnan
Is there any particular reason for not following react-rails standard installation? For instance, not using app/components for React components.
@akhilgkrishnan Is there any particular reason for not following react-rails standard installation? For instance, not using
app/componentsfor React components.
I tried that, but its was not working
I would recommend starting over again. Because, for any reason, there are issues with your installation. As an example, I can mention the mismatch between react-rails version in gemfile (2.6.2) and package.json (2.7.1). For gems like react-rails with ruby and npm packages, ensure you have the exact versions on both sides.
Besides that, I recommend using the newly released react-rails v3. The installation documentation should be straightforward. Ensure you get your react component rendered on the page, then go for adding styles.
@ahangarha Its working after upgrading to react-rails 3.0. Thanks :)
Thanks for the update