Giter Club home page Giter Club logo

react-dayjs's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

react-dayjs's Issues

No support for React v18?

I received the following error whilst attempting to install via npm:

ERESOLVE unable to resolve dependency tree
While resolving: [email protected]
Found: [email protected]
node_modules/react
  react@"^18.2.0" from the root project

Could not resolve dependency:
peer react@"^15.6.0 || ^16.0.0 || ^17.0.0" from [email protected]
node_modules/react-dayjs
  react-dayjs@"*" from the root project

Am I correct in assuming that this is because DayJs has yet to be marked as compatible with React v18?

Could not resolve dependency with React @17.0.1

When trying to update the dayjs package with $npm update , the following message is produced from npm

$ npm update
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR! react@"^17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^15.6.0 || ^16.0.0" from [email protected]
npm ERR! node_modules/react-dayjs
npm ERR! react-dayjs@"^0.2.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

this what $npm outdated produced

$ npm outdated
Package Current Wanted Latest Location Depended
by
@testing-library/jest-dom 5.11.6 5.11.9 5.11.9 node_modules/@testing-library/jest-dom client
@testing-library/react 11.2.2 11.2.3 11.2.3 node_modules/@testing-library/react client
@testing-library/user-event 12.5.0 12.6.0 12.6.0 node_modules/@testing-library/user-event client
axios 0.21.0 0.21.1 0.21.1 node_modules/axios client
dayjs 1.9.7 1.10.3 1.10.3 node_modules/dayjs client
web-vitals 0.2.4 0.2.4 1.1.0 node_modules/web-vitals client

something similar had happened more than a month ago when I was installing dayjs and initiating this project

Version 0.2.0 was not packaged correctly

It looks as if the release was not packaged correctly:

error: Error: While trying to resolve module `react-dayjs` from file `/home/user/project/SomeFile.js`, the package `/home/user/project/node_modules/react-dayjs/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/home/user/project/node_modules/react-dayjs/dist/index.js`. Indeed, none of these files exist:

  * /home/user/project/node_modules/react-dayjs/dist/index.js(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
  * /home/user/project/node_modules/react-dayjs/dist/index.js/index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)

I think it is because of webpack which seemes to be used in this project

Fix vulns and allow react 17.0.1

Hey,

I have to use this with react 17.0.1. I have also found that dayjs reports 2 vulnerabilities.

So, I have forked your repo and fixed the problems (upgrade branch) and all the tests still pass (at least, I didn't break any more -- the linter is complaining about state hoisting). It's easy enough for you to fix yourself, or I could issue a pull request if you like.

Bryan

Upgrade to babel 7

This currently uses babel 6 for building. It should be updated to use babel 7 and the newer babel plugins (that start with @babel/...) over the older versions.

This is a good first issue for someone who wants to give it a shot!

Missing Type Support for react-dayjs

Description:

I noticed that react-dayjs does not provide proper type support, which can lead to potential issues and lack of type safety in TypeScript projects. This issue addresses the missing type support and enhances the developer experience when using react-dayjs with TypeScript.

Currently, when using react-dayjs in a TypeScript project, the type information for the components and utility functions is not available or incomplete. This makes it challenging to leverage the full benefits of TypeScript, such as autocompletion, type checking, and improved code documentation.

It would be great to have complete and accurate type definitions for all the components, props, and utility functions provided by react-dayjs. This would enable TypeScript developers to write more reliable code and catch errors during development rather than runtime.

Reproduction Steps:

  1. Create a new React project with TypeScript.
  2. Install react-dayjs using npm or yarn.
  3. Import a react-dayjs component or utility function into a TypeScript file.
  4. Attempt to use TypeScript features such as autocompletion or type checking with the imported entity.
  5. Observe that the type information is missing or incomplete, leading to potential issues and reduced productivity.

Expected Behavior:

When using react-dayjs in a TypeScript project, the type definitions for all the components, props, and utility functions should be provided, allowing developers to benefit from TypeScript's static typing capabilities. This includes accurate prop typings, return types, and any additional type information necessary to ensure type safety.

Current Behavior:

Currently, react-dayjs does not provide comprehensive type support, leading to a lack of type safety and hindered development experience for TypeScript users. The existing type definitions are either missing, incomplete, or inaccurate, making it difficult to leverage TypeScript's features effectively.

Proposed Solution:

One possible solution is to update the react-dayjs package to include complete and accurate type definitions for all the exposed entities. This can be achieved by utilizing TypeScript declaration files (.d.ts) or TypeScript interfaces.

Alternatively, if the maintainers prefer community contributions, providing guidelines on how to contribute type definitions would be beneficial. This would allow TypeScript developers to contribute and maintain the type support for react-dayjs.

Additional Context:

Type support is crucial for projects using TypeScript as it helps catch potential errors during development and improves the overall stability and maintainability of the codebase. By addressing the missing type support in react-dayjs, we can enhance the experience for TypeScript users and attract a wider range of developers to use and contribute to the project.

Please let me know if you need any further assistance or if there are any specific details you would like to add to the title or description!

Point package.json main to existing file

The main property in package.json points to dist/index.js. However dist/index.js is not bundled on NPM, so if you install react-dayjs via NPM and try to load it, it fails. Either bundle dist/index.js or point main to source/index.jsx

Declaration file error

Error code as generated by vs code:
"
Could not find a declaration file for module 'react-dayjs'. 'C:/Users/User/{project}/node_modules/react-dayjs/dist/index.js' implicitly has an 'any' type.
Try npm i --save-dev @types/react-dayjs if it exists or add a new declaration (.d.ts) file containing declare module 'react-dayjs';
"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.