kevinvangelder Github contribution chart
kevinvangelder Github Stats
kevinvangelder Most Used Languages

Activity

04 Oct 2022

Kevinvangelder

Add React Navigation getId link to docs

Created On 04 Oct 2022 at 05:45:55

Kevinvangelder

Tip for recursive routes

Pushed On 04 Oct 2022 at 05:45:31

Kevinvangelder

Add React Navigation getId link to docs

Pushed On 04 Oct 2022 at 12:05:25

Kevinvangelder

🧍‍♂️ React Native + Next.js, unified.

Forked On 04 Oct 2022 at 12:01:32
Issue Comment

Kevinvangelder

Navigating Recursively Not Supported?

I have a dynamic route /:username. On mobile, if I navigate from /user1 to /some-other-page and link to /user2, rather than pushing a copy of that page with the new username parameter it navigates back to the previous page with the old username parameter. Is there some option or setting we need to enable in order to utilize recursive navigation?

Forked On 03 Oct 2022 at 11:29:57

Kevinvangelder

Okay, that's useful, but as someone who's been using React Navigation for years I've never needed that prop until using React Navigation + Solito, so it would have been helpful to me to have had this linked from the Dynamic Route section in the documentation.

Thanks again!

Commented On 03 Oct 2022 at 11:29:57
Issue Comment

Kevinvangelder

Navigating Recursively Not Supported?

I have a dynamic route /:username. On mobile, if I navigate from /user1 to /some-other-page and link to /user2, rather than pushing a copy of that page with the new username parameter it navigates back to the previous page with the old username parameter. Is there some option or setting we need to enable in order to utilize recursive navigation?

Forked On 03 Oct 2022 at 10:52:10

Kevinvangelder

@nandorojo That worked, thanks! Did I miss this somewhere in the documentation? If not, it would be great if it could be added.

Commented On 03 Oct 2022 at 10:52:10
Issue Comment

Kevinvangelder

Debug mode?

Is there a debug mode I can enable to log Link presses and push/reset/etc calls? My links are working fine in Next but are not working at all in Expo.

Forked On 29 Sep 2022 at 11:01:58

Kevinvangelder

If you want to reproduce the issue I had you can do so by nesting some valid screens that aren't direct children of the tab navigator in the linking config:

screens: {
  Login: '/login',
  BottomTabs: {
    screens: {
      Main: '/home', // Valid child of bottom tabs
      UserDetails: '/user/:id', // Deeply nested screen, not a direct descendant 
     },
   }
 } 

Commented On 29 Sep 2022 at 11:01:58
Issue Comment

Kevinvangelder

Debug mode?

Is there a debug mode I can enable to log Link presses and push/reset/etc calls? My links are working fine in Next but are not working at all in Expo.

Forked On 23 Sep 2022 at 06:00:52

Kevinvangelder

I was only getting errors if the link matched a key that does not exist in the navigation stack or if the link did not exist at all, but my problem was that the link existed but navigation to the key failed because I had nested it (I'm using a BottomTabNavigator and did not fully understand how the linking should be configured). Maybe this is an abnormal enough edge-case that it doesn't need special error handling, but it sure would have saved me a day or two of debugging.

Commented On 23 Sep 2022 at 06:00:52
Issue Comment

Kevinvangelder

Debug mode?

Is there a debug mode I can enable to log Link presses and push/reset/etc calls? My links are working fine in Next but are not working at all in Expo.

Forked On 21 Sep 2022 at 06:17:49

Kevinvangelder

Alternatively, in dev mode could clicking a link that has no matching route simply log could not find route: ${route}? It seems I had misconfigured my linking to nest screens, it would have been very useful to know that the route could not be found versus it seeming like the press wasn't even registering.

Commented On 21 Sep 2022 at 06:17:49

Kevinvangelder

Fix code examples

Created On 17 Aug 2022 at 07:03:12
Create Branch
Kevinvangelder In infinitered/mst-reference-pool Create Branchreadme-array-replace

Kevinvangelder

MST Reference Pool is a MobX-State-Tree extension that allows you to use references to a pool of model instances in any store.

On 17 Aug 2022 at 07:03:08
Issue Comment

Kevinvangelder

Unable to use NSFWJS with File interface

I'm building a feature where users can upload files via input type file and then I want to validate images before they're uploaded to the backend. To do that I created input and am listening to changes (selected files)

 <input
        type="file"
        onChange={handleChange}
      /> 

However, I noticed that the library works with the HTMLImageElement interface, while the input type file returns the File interface.

So I started playing around, looking for workarounds. I tried to take it by creating an invisible image

 <img
        crossOrigin="anonymous"
        id="img"
        alt="img"
      /> 

And to put the source in it manually.

 const  selectedPicture = event.target.files[0]
    const reader = new FileReader()

    const imgTag = document.getElementById('img') as HTMLImageElement
    imgTag.src = URL.createObjectURL(selectedPicture)
    imgTag.title = selectedPicture.name

    const model = await nsfwjs.load()
    const predictions = await model.classify(imgTag)
    console.log('Predictions: ', predictions) 

Unfortunately, it doesn't work as I expected. The predictions log always return a dummy response, saying everything is neutral.

Is it possible to make nsfwjs work with a file that comes from input?

Forked On 30 Jul 2022 at 04:50:32

Kevinvangelder

You can use the FileReader API to locally load the selected image: https://stackoverflow.com/a/3814285

Commented On 30 Jul 2022 at 04:50:32

Kevinvangelder

Calling window when importing module

is it possible not to call window when importing reactotron-react-js, just on configure?

import Reactotron from 'reactotron-react-js' // calls window

Reactotron.configure() // only calls window here

Forked On 21 Jul 2022 at 11:11:13

Kevinvangelder

Resolved by #862

Commented On 21 Jul 2022 at 11:11:13

Kevinvangelder

undo const to let change

Pushed On 21 Jul 2022 at 07:43:11

Kevinvangelder

NextJS Fix

Created On 21 Jul 2022 at 06:19:43

Kevinvangelder

only protect client section

Pushed On 21 Jul 2022 at 06:18:04
Create Branch

Kevinvangelder

Reactotron's react-dom client.

On 21 Jul 2022 at 05:41:55

Kevinvangelder

window is not defined [Reference Error]

Issue Detail

While bootstrapping reactotron-react-js with NextJS project, NextJS throws this error bellow :

`Server Error ReferenceError: window is not defined

This error happened while generating the page. Any console logs will be displayed in the terminal window. Call Stack getNavigatorProperty file:///home/yasir/Desktop/practise/aurora/aurora/node_modules/reactotron-react-js/dist/index.js (1:1307) Object. file:///home/yasir/Desktop/practise/aurora/aurora/node_modules/reactotron-react-js/dist/index.js (1:1641) Module._compile node:internal/modules/cjs/loader (1092:14) Object.Module._extensions..js node:internal/modules/cjs/loader (1121:10) Module.load node:internal/modules/cjs/loader (972:32) Function.Module._load node:internal/modules/cjs/loader (813:14) Module.require node:internal/modules/cjs/loader (996:19) require node:internal/modules/cjs/helpers (92:18) Object.reactotron-react-js file:///home/yasir/Desktop/practise/aurora/aurora/.next/server/pages/index.js (198:18) webpack_require file:///home/yasir/Desktop/practise/aurora/aurora/.next/server/webpack-runtime.js (33:42) eval webpack-internal:///./utils/reactortron.js (2:77) Object../utils/reactortron.js file:///home/yasir/Desktop/practise/aurora/aurora/.next/server/pages/index.js (88:1) webpack_require file:///home/yasir/Desktop/practise/aurora/aurora/.next/server/webpack-runtime.js (33:42) eval webpack-internal:///./pages/index.js (13:76) Object../pages/index.js file:///home/yasir/Desktop/practise/aurora/aurora/.next/server/pages/index.js (77:1) webpack_require file:///home/yasir/Desktop/practise/aurora/aurora/.next/server/webpack-runtime.js (33:42)`

Mitigation

I have used typeof window ==="undefined" but reactotron-react-js still throws an error, I think this line https://github.com/infinitered/reactotron-react-js/blob/ac7f1e951a85326c8e717c08f0f1e11e507e993a/src/index.ts#L33 might be causing some problems, if window is undefined then there should be no need to createSocket, just throw a socket creation error.

Technical Details

  • NextJS version : ^10.2.3
  • React version : 17.0.1
  • reactotron-react-js version : ^3.3.7

Forked On 20 Jul 2022 at 11:42:20

Kevinvangelder

I am also experiencing this error. According to this StackOverflow, wrapping it in a useEffect may solve our problem. https://stackoverflow.com/questions/55151041/window-is-not-defined-in-next-js-react-app

Commented On 20 Jul 2022 at 11:42:20