Relay | Apollo | |
---|---|---|
Built by | Facebook (Check out the project on GitHub) | Meteor (Check out the project on GitHub) |
Frontend Technologies | Requires React / React Native and configuration of Babel plugin | Framework and platform agnostic (works with any JS framework such as React, Angular or Vue as well as on the native mobile platforms) |
GraphQL API | Requires a certain structure in the GraphQL schema | Works with any GraphQL schema |
Complexity | Slow learning curve: Lots of powerful magic happening behind the scenes | Low entrance barrier: Let's you get started quickly and involves more manual work for certain features |
Flexibility | Almost no flexibility, strict rules how to |
/** | |
* Copyright (c) 2013-present, Facebook, Inc. | |
* | |
* This source code is licensed under the MIT license found in the | |
* LICENSE file in the root directory of this source tree. | |
* | |
* @providesModule shallowEqual | |
* @typechecks | |
* @flow | |
*/ |
package main | |
import ( | |
"fmt" | |
"golang.org/x/text/runes" | |
"golang.org/x/text/transform" | |
"golang.org/x/text/unicode/norm" | |
"strings" | |
"unicode" | |
) |
import React from 'react' | |
import axios, { post } from 'axios'; | |
class SimpleReactFileUpload extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state ={ | |
file:null | |
} |
// Future versions of Hyper may add additional config options, | |
// which will not automatically be merged into this file. | |
// See https://hyper.is#cfg for all currently supported options. | |
module.exports = { | |
config: { | |
// Choose either "stable" for receiving highly polished, | |
// or "canary" for less polished but more frequent updates | |
updateChannel: 'stable', |
UPDATE: I finally made an NPM package for this component! It is made with TypeScript, and now has a fully customizable styling system. It is also far ahead of this wrapper at this point. Check it out here if you'd like: https://github.com/csandman/chakra-react-select
In order to use this component, you can implement it and use it like you would normally use react-select. It should accept all of the props that the original takes, however customizing the theme or the components could break this implementation. There are also a few extra things you can do with this wrapper that pull from the chakra library.
- You can pass the
size
prop with eithersm
,md
, orlg
. These will reflect the sizes available on the Chakra<Input />
component (with the exception ofxs
because it's too small to work). - In your options objects, you can add the key
isFixed
to emulate the exa
package httpclient | |
import ( | |
"net" | |
"net/http" | |
"time" | |
) | |
type Config struct { | |
ConnectTimeout time.Duration |
package main | |
import ( | |
"fmt" | |
) | |
// Use map[string]interface{} to pair functions to name | |
// Could maybe use anonymous functions instead. Might be clean | |
// in certain cases | |
var funcMap = map[string]interface{}{ |
While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.
Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.
// create a bookmark and use this code as the URL, you can now toggle the css on/off | |
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3 | |
javascript: (function() { | |
var elements = document.body.getElementsByTagName('*'); | |
var items = []; | |
for (var i = 0; i < elements.length; i++) { | |
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) { | |
items.push(elements[i]); | |
} | |
} |