Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use the lib with Typescript #27

Closed
jpcmf opened this issue May 11, 2021 · 1 comment
Closed

Can't use the lib with Typescript #27

jpcmf opened this issue May 11, 2021 · 1 comment

Comments

@jpcmf
Copy link

jpcmf commented May 11, 2021

Hello friend. I´m trying to use the lib with .tsx with Next.js but it´s not working.

Could not find a declaration file for module 'react-odometerjs'. '.../node_modules/react-odometerjs/dist/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/react-odometerjs` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-odometerjs';`ts(7016)

Any tip?

Thank you :)

import dynamic from 'next/dynamic';

const Odometer = dynamic(import('react-odometerjs'), {
  ssr: false,
  loading: () => 0,
});

import { Container, Content, Title, Item } from './styles';

export function OurNumbers() {
  return (
    <Container>
      <Title>Números</Title>
      <Content>
        <Item>
          <Odometer value={1234} format="(.ddd),dd" />
        </Item>
        <Item>
          <Odometer value={1234} format="(.ddd),dd" />
        </Item>
        <Item>
          <Odometer value={1234} format="(.ddd),dd" />
        </Item>
      </Content>
    </Container>
  );
}
@jpcmf jpcmf closed this as completed May 22, 2021
@TsubasaOura
Copy link

@jpcmf Has this issue been resolved? If it has been resolved, I would like to hear about the solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants