It it okay to use Chakra UI hooks (useBoolean, useConst) for convenience in a project, or should I stick with built-in React hooks? - react-hooks

I'm interested in these hooks: useBoolean, useConst. Technically, you can achieve the same behavior with the built-in hooks. But those offered by Chakra UI are more convenient.
What do you think? Is it okay to use the hooks in your project for convenience, or is it going to complicate things in the future and make it more difficult to maintain the project? Should I React built-in ones whenever possible?
Chakra UI is a big part of the project I'm working on.

Related

Is there a way to replicate the Wix Repeater element in swift / xcode?

I have created a webapp using Wix, which relies heavily on the repeater element to display content from a database inside a repeating element. Repeaters do pretty much exactly what I want, but I realize they are built on a pretty sophisticated API, and there's a lot of stuff making this happen in the background.
Ultimately for this project, a native iOS app is the end goal. However, I have no experience in xcode - but willing to learn. Before I get in too deep, is there any kind of functionality I could find to achieve something like this?
Thanks in advance
You can't convert Wix Repeater element to Xcode. But, you can make deep customization to your Wix elements by using Wix Corvid.
If you not familiar with it, it's is a developing platform integrated into the Wix ecosystem that allows users to build advanced sites. Among other things, it’s able to create and manage databases, build dynamic pages, host user-generated content and more.

Import ReactNative libraries into a NativeScript application

I have some Android development experience along with React.js. I'm working on a new mobile project and I haven't been sold entirely on either framework yet.
I'm thinking about using the NativeScript framework for its maturity and because it has more libraries with the functionality that I need but I'd like to design my views in a manner similar to ReactJS. I know I could write my own modules for ReactNative but that would require then I'd have to write modules for both Android and iOS. I'd like to avoid that if I could.
I was thinking about importing the necessary ReactNative libraries into a NativeScript project and then being able to write views in a way similar to ReactNative but still using NativeScript.
Is this doable?
Not sure about your exact question. I did just see an integration between Preact and NativeScript you may be interested in. Take a look here: https://github.com/staydecent/nativescript-preact
I believe that repo is in the early stages, but if enough people want something similar, it'll get worked on faster.
Using React Native in NativeScript is not the right approach, either of it are not built to work together and wouldn't work due to architectural reasons. Here is an NativeScript official comparison of these two.
Both are built for solving same problem (building native apps using JS, without webview hybrid app approach) by trans-compiling XML based view layer(which both these framework has its own syntax and so cant be shared) to build Native UI.
Said that view layer has its own syntax for both and cant be shared, model and controller layer cant be shared as well, due to the fact that NativeScript has few things packed as part of the application package, like JavaScript runtime, c++ and Java API layer which helps in exposing all the Native API without the need for any explicit native API wrapper we have in ReactNative.
React Native have platform specific UI components as well as hardware capabilities, which is not the case with NativeScript. Offcouse, that comes with the cost of a fatter app package size(50+MB) compared to <10MB for ReactNative. More on ReactNative vs NativeScript comparison here.

How to use blueprintjs without Typescript?

I am new to React and I just stumbled to amazing Blueprint components. However, I am unable to use it and I am confused by the installation guide. Its quite different from what I am used so far.
Can anyone explain me how to use Blueprint without Typescript?
You can simply ignore the Typescript parts. Since you are writing a React app, it needs to be compiled through Babel anyways.
I never used Typescript before and also just started to use blueprint a few days ago and was able to use the JSX components completely without any Typescript knowledge.
Just start using it like any other React components you write - or use DIVs with the blueprint CSS classes directly when necessary. Its up to you.

Completely customized UI in iOS 7

Assume you have to develop an app, which needs a completely customized user interface so that you can not use any standard UI objects in Xcode.
How would you proceed to create such an user interface? Would you use the interface builder? Would you create something like a master parent UIView? What are the best practices to achieve this?
What would be the most elegant solution with less code duplication?
If by "complete customization" you mean the look and feel of the app,
then I suggest to design the IB objects you require using some design IDE's such as photoshop and then use those slices for your project.
This is the best option I find so far to get a complete customized look with minimal code, and by minimal, I mean you don't actually require any coding. You can do this complete customization within your Interface builder.
However, I don't think you can completely ignore standard UI objects as you require them to add basic functionality.
If customized controls are what you are looking for, then I suggest you to create separate custom control classes so that they can be reused anywhere in your project, or in other projects too.
Here are two wonderful tutorials on custom controls:
http://www.raywenderlich.com/36288/how-to-make-a-custom-control
http://www.raywenderlich.com/56885/custom-control-for-ios-tutorial-a-reusable-knob
Hope this helps!

Build an app with marionettejs with requirejs?

I have used backbone boilerplate on the past
https://github.com/backbone-boilerplate/backbone-boilerplate
I want to use marionette on my next project and I have found this
https://github.com/BoilerplateMVC/Marionette-Require-Boilerplate
My question is if it's a good idea to go with the marionette boilerplate or start form scratch.
As an aside, I'd like to suggest you give Yeoman a shot for scaffolding your first Marionette app. Yeoman works via what are called "generators", and provide much more than the the above Boilerplate MVC can offer you (Chai and Sinon for testing, Bower for client-side package management, etc...). Plus, Addy Osmani, who runs backbone-boilerplates is one of the heads of the project. Check out generator-marionette here.
I haven't used BoilerPlate, but glancing through it, it certainly seems like a valid approach to writing Marionette apps. If you're just getting started it will certainly help you see how the various pieces are supposed to be used. One gripe I've got is the folder structure. I prefer to break my applications down into modules, and then add models, collections, views, etc under each module. But this will certainly get you up and running quick, and there's nothing stopping you from customizing it to suit your needs.
I agree with others here: it is a useless limitation to imitate a folder structure that follows the 'old mvc model for server-side code'. You will remain more flexible further down the road if you think of your application strictly as completely self-containing modules, i.e. they contain their own controller/router/views/collections/templates etc. You can have a separate folder structure for shared code that is not a module, although anything can be made a module :)
Regarding boilerplate code and generators: i think in the beginning you should actually NOT do it, because you won't understand what you're doing. But that's just my personal opinion.

Resources