Including themes in tsx file

UI Components for React
Post Reply
shilpikanade
Posts: 15
Joined: 04 Apr 2018, 19:45

05 Apr 2018, 00:46

Hello -

How can I include the themes and use them in my tsx (Typescript JSX)file...

import { DataTable } from 'primereact/components/datatable/DataTable'
import { Column } from 'primereact/components/column/Column'
import axios from 'axios'
import { Button } from 'primereact/components/button/Button'
import { Dialog } from 'primereact/components/dialog/Dialog'
import { InputText } from 'primereact/components/inputtext/InputText'

This didn't work

import 'primereact/resources/primereact.min.css'

Thanks, Shilpi

shilpikanade
Posts: 15
Joined: 04 Apr 2018, 19:45

05 Apr 2018, 15:14

These are the errors that I got:

..\node_modules\primereact\resources\themes\omega\fonts\roboto-v15-latin-regular.woff2 Unexpected character '' (1:4)
You may need an appropriate loader to handle this file type.

Module parse failed: ..\node_modules\primereact\resources\themes\omega\fonts\roboto-v15-latin-regular.eot Unexpected character '' (1:2)
You may need an appropriate loader to handle this file type.

Thanks, Shilpi

shilpikanade
Posts: 15
Joined: 04 Apr 2018, 19:45

05 Apr 2018, 15:22

I got it to work, I needed to add the corresponding loader -

{ test: /\.(eot|woff|woff2|ttf)$/, loader: "file-loader" }

in webpack.config file.

Thanks, Shilpi

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

10 May 2018, 15:14

Thanks a lot for the update!

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 18 guests