React Native - React.createElement is Not a Function - javascript

Figured I would see what React Native is all about, so I followed the instructions here and can't even get the out of the box project to run correctly. Chrome dev tools throws all sorts of errors. Here is the stack trace shown in the simulator, anybody else run into this?

It seems like what may have happened here is that you named your project "React". The CLI replaces the word "SampleApp" with the name that you specified in the sample files that it generates.
This is the original file here: https://github.com/facebook/react-native/blob/master/Examples/SampleApp/index.ios.js You can see where it has "SampleApp" in a few places where on your file has "React" for all of them.
It really wasn't your fault, the CLI just needs to be a little smarter and not allow someone to create a project named "React". :)

I got the same error when I used different version of JSXTransformer.js and react.js . Using 0.13.3 from cdn solved the problem. https://cdnjs.com/libraries/react/

Related

Intellij does not seem to compile or interpret JavaScript properly, and any changes or settings on IntelliJ cannot be saved

I'm currently learning React Native and JavaScript for a mobile application development. I have been in this problem for quite a while and wish to know what went wrong.
After having downloaded Expo and open the App.js through Intellij, I noticed that the code does not show any color for the important keywords, and that there isn't any meaningful suggestion for library or methods whenever I made changes on the JavaScript/HTML code. This makes me wonder, if JavaScript cannot be interpreted on IntelliJ or do I need to install any additional software for the compiler to do so.
[The App.js file when I opened it][1]
Moreover, whenever I made any changes to the code line, it does not allow me to save the code. At first, I tried to avoid the error message, but the changes cannot be viewed on my phone as well when I opened Expo. This is the error messages:
[Error shows that I cannot save the file][2]
[Unable to save settings][3]
Is there anything I can do to resolve these errors? Thank you!
[1]: https://i.stack.imgur.com/AA4Uk.png
[2]: https://i.stack.imgur.com/BdZEX.png
[3]: https://i.stack.imgur.com/41ncv.png

"Module not found: can't resolve..." with React app

I'm new to it, seems like a simple issue but I can't figure out why is my React app breaking with this error. I've even copied the whole source file and pasted, but still have this going on. What could be some the reasons?
From my experience, that's usually two issues: Either your Node.js is outdated when it comes to importing libraries, or you are importing a local file using a wrong path. I suggest you changing paths until you get it right.

How do I enable JavaScript type checking in Vue files on Visual Studio Code?

I have found the settings in Visual Studio Code to enable type checking for JavaScript in JS files. Such that: Bad code is highlighted and it also shows the reason why it's bad code
This behavior does not occur for JavaScript code in Vue files. I have searched through all the settings in Visual Studio Code. I have scoured the internet for any extension that can do this for me to no avail.
How can I make my Vue files type-check the JavaScript in them?
LOL. I found the answer.
All I had to do was add //#ts-check directly underneath the script tag and type checking was enabled.
So HAPPY!!!
Thank you, everyone, for your input
For best results I'd suggest starting a new project using vue-cli and selecting the options for TypeScript and ESLint. You'll also need the ESLint extension for VS Code.
Here's a helpful blog post showing the parts of this process.
Once you have a nicely working setup with the clean project, then move the code over. I suggest this because getting all the config right can be a mess with an existing project.

React native redux - Connect (Cannot read property toLowerCase of undefined)

Pretty new to react-native developpement, apologies if my issue is obvious. I've been searching for quite a long time before posting.
It has been working perfectly for quite a long time.
I can't identify what I have done to break things up.
I believe I'm importing react redux properly, using {connect} properly. I didn't change the way I'm using it.
Also stacktrace is not really helping me ..
Stacktrace Image
Github to my project if need be :
github
And the most important file :
PageLecture.js
Also one thing weird I noticed, is that for some time this error was only occuring when I was using my phone, not emulator. Emulator was working fine. Now this error is also on emulator.
OK so this was actually pretty dumb, and not related to redux connect method (as I thought initially).
It was due to me using at some point a Sound module which I was initializing wrongly (should have done that outside of my PageLecture class, then I can use it inside this very class).
I'd like to mark as solve but looks like I don't have this option available.

Flashdevelop for webgl with haxe & stdjs

I am currently trying to get an instance of the WebGL context in HaxeJS using FlashDevelop. I would like to use the stdjs library.
I have imported the dependencies using haxelib with:
haxelib git xirsys_stdjs https://github.com/xirsys/stdjs.git haxelib
I tested its availability with:
haxelib list
I then added it to the library section in FlashDevelop - see pic
**I have included the the library in the classpaths (I really don't know if I should, but without it, compile won't even take place) - See pic **
I've then taken the WebGL specific code from the following github repo:
https://github.com/mikecann/WebGLTerrainicles/blob/master/src/Main.hx
When I try to compile the project, it opens up my browser as expected, however, in the console there is an issue as there are missing libraries:
Obviously I'm missing something here (perhaps in the import process?) - I've looked but can't find much information on getting WebGL working for Haxe with the stdjs externs etc using FlashDevelop and any help would be great.
Looks like there is a problem with xirsys_stdjs lib.
The reference project you link to is using only one file called Html5Dom.hx (originally from Jeash project) to define the HTML5/webgl API. You don't need xirsys_stdjs if you reuse this file.
While you're at it, mikecann's project seems to include a lot of basic classes to get started writing webgl in haxe.

Categories

Resources