xxxxxxxxxx
datacenter = "dc-jakarta"
node_name = "node-jakarta-01"
data_dir = "/Users/restuwahyusaputra/.consul"
bootstrap = true
server = true
enable_debug = true
enable_script_checks = true
rejoin_after_leave = true
leave_on_terminate = false
bootstrap_expect = 1
raft_protocol = 3
// log_level = "INFO"
ports {
http = -1
https = 8501
grpc = -1
grpc_tls = 8503
}
ui_config {
enabled = true
}
performance {
raft_multiplier = 1
}
// limits {
// http_max_conns_per_client = 0
// rpc_max_conns_per_client = 0
// request_limits = {
// mode = "permissive"
// read_rate = 100
// write_rate = 100
// }
// }
http_config {
response_headers = {
"Access-Control-Allow-Origin" = "*"
}
}
acl {
enabled = true
enable_token_persistence = true
default_policy = "deny"
// enable_token_replication = true
tokens {
master = "a6c0ab05-1089-4172-b848-5519d78f0675"
agent = "a6c0ab05-1089-4172-b848-5519d78f0675"
// default = "eb7daee5-6c8f-4e75-ad3c-c40a41a4c623"
}
}
tls {
defaults = {
cert_file = "/Users/restuwahyusaputra/.self_signed/cert.crt"
key_file = "/Users/restuwahyusaputra/.self_signed/key.key"
}
}
// service {
// id = "abcd"
// name = "abc-service"
// address = "localhost"
// port = 3000
// tags = ["api", "development", "microservice"]
// meta = {
// name = "abc"
// }
// checks = [{
// id = "abcd"
// name = "abc-health"
// http = "localhost:3000"
// method = "GET"
// interval = 30
// timeout = 10
// tls_skip_verify = false
// }]
// }
xxxxxxxxxx
npm install react-toast-plus
Or with Yarn:
yarn add react-toast-plus
import React from 'react';
import ReactDOM from 'react-dom';
import { ToastProvider } from 'react-toast-plus';
import App from './App';
ReactDOM.render(
<ToastProvider>
<App />
</ToastProvider>,
document.getElementById('root')
);
You can use the useToast hook to add toasts:
import React from 'react';
import { useToast } from 'react-toast-plus';
const App = () => {
const { addToast } = useToast();
const showToast = () => {
addToast('This is a toast!');
};
return <button onClick={showToast}>Show Toast</button>;
};
xxxxxxxxxx
React Toast Plus is a lightweight, customizable toast notification library for React.
Installation
To install react-toast-plus, run:
npm install react-toast-plus
Or with Yarn:
yarn add react-toast-plus
Basic Setup
Wrap your application with the ToastProvider to enable toast notifications:
import React from 'react';
import ReactDOM from 'react-dom';
import { ToastProvider } from 'react-toast-plus';
import App from './App';
ReactDOM.render(
<ToastProvider>
<App />
</ToastProvider>,
document.getElementById('root')
);
Adding Toasts
import React from 'react';
import { useToast } from 'react-toast-plus';
const App = () => {
const { addToast } = useToast();
const showToast = () => {
addToast('This is a toast!');
};
return <button onClick={showToast}>Show Toast</button>;
};
xxxxxxxxxx
React Toast Plus install
npm install react-toast-plus
Or with Yarn:
yarn add react-toast-plus
Basic Setup
Wrap your application with the ToastProvider to enable toast notifications:
import React from 'react';
import ReactDOM from 'react-dom';
import { ToastProvider } from 'react-toast-plus';
import App from './App';
ReactDOM.render(
<ToastProvider>
<App />
</ToastProvider>,
document.getElementById('root')
);
Adding Toasts
You can use the useToast hook to add toasts:
import React from 'react';
import { useToast } from 'react-toast-plus';
const App = () => {
const { addToast } = useToast();
const showToast = () => {
addToast('This is a toast!');
};
return <button onClick={showToast}>Show Toast</button>;
};