You probably came here because your code is calling your component as a plain function call. This is now deprecated:
var MyComponent = require('MyComponent');
function render() {
return MyComponent({ foo: 'bar' }); // WARNING
const NoChildrenAllowed: ReactFC<NoChildren> = () => null | |
const RequireSingleChild: ReactFC<Required<SingleChild>> = () => null | |
type TProps = Required<SomeChildren> & { | |
otherProp: number | |
} | |
const RequireMoreChildrenAndOtherProps: ReactFC<TProps> = () => null |
import Foundation | |
struct Country { | |
let name: String | |
let capital: String | |
var visited: Bool | |
} | |
extension Country: Equatable { | |
static func == (lhs: Country, rhs: Country) -> Bool { |
use std::path::PathBuf; | |
use std::collections::{BTreeMap, HashMap, HashSet}; | |
use std::thread; | |
use std::os::raw::c_void; | |
use std::rc::Rc; | |
use std::cell::{Cell, RefCell}; | |
use std::i16; | |
use std::time::Instant; | |
use failure::{err_msg, Error}; |
- (void)viewWillAppear:(BOOL)animated | |
{ | |
[super viewWillAppear:animated]; | |
NSIndexPath *selectedRowIndexPath = [self.tableView indexPathForSelectedRow]; | |
if (selectedRowIndexPath) { | |
[self.tableView deselectRowAtIndexPath:selectedRowIndexPath animated:YES]; | |
[[self transitionCoordinator] notifyWhenInteractionEndsUsingBlock:^(id<UIViewControllerTransitionCoordinatorContext> context) { | |
if ([context isCancelled]) { | |
[self.tableView selectRowAtIndexPath:selectedRowIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone]; |
defmodule Config do | |
@moduledoc """ | |
This module handles fetching values from the config with some additional niceties | |
""" | |
@doc """ | |
Fetches a value from the config, or from the environment if {:system, "VAR"} | |
is provided. | |
An optional default value can be provided if desired. |
if (!!root.EventSource) { | |
/** | |
* This method wraps an EventSource as an observable sequence. | |
* @param {String} url The url of the server-side script. | |
* @param {Observer} [openObserver] An optional observer for the 'open' event for the server side event. | |
* @returns {Observable} An observable sequence which represents the data from a server-side event. | |
*/ | |
dom.fromEventSource = function (url, openObserver) { | |
return new AnonymousObservable(function (observer) { |
//: Playground - noun: a place where people can play | |
import Cocoa | |
import Darwin | |
func htons(value: CUnsignedShort) -> CUnsignedShort { | |
return (value << 8) + (value >> 8) | |
} | |
let INADDR_ANY = in_addr(s_addr: 0) |
import Foundation | |
struct Regex { | |
var pattern: String { | |
didSet { | |
updateRegex() | |
} | |
} | |
var expressionOptions: NSRegularExpressionOptions { | |
didSet { |
//! An example demonstrating that glium has a problem using instancing when | |
//! the vertex buffer is a slice with a non-zero starting index. | |
//! | |
#[macro_use] extern crate glium; | |
use glium::{DisplayBuild, Surface}; | |
// Vertex Shader: | |
static VERTEX_SHADER_SRC: &'static str = r#" | |
#version 140 |